/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('iotcc', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AddCidrToConnectionPoolRequest {
  cidrs?: [ string ](name='Cidrs'),
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  connectionPoolId?: string(name='ConnectionPoolId', example='cp-bp11234abctmno0hdq****'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model AddCidrToConnectionPoolResponseBody = {
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model AddCidrToConnectionPoolResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddCidrToConnectionPoolResponseBody(name='body'),
}

async function addCidrToConnectionPoolWithOptions(request: AddCidrToConnectionPoolRequest, runtime: Util.RuntimeOptions): AddCidrToConnectionPoolResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.cidrs)) {
    query['Cidrs'] = request.cidrs;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.connectionPoolId)) {
    query['ConnectionPoolId'] = request.connectionPoolId;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddCidrToConnectionPool',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addCidrToConnectionPool(request: AddCidrToConnectionPoolRequest): AddCidrToConnectionPoolResponse {
  var runtime = new Util.RuntimeOptions{};
  return addCidrToConnectionPoolWithOptions(request, runtime);
}

model AddIoTCloudConnectorToGroupRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='true'),
  ioTCloudConnectorGroupId?: string(name='IoTCloudConnectorGroupId', example='iotccg-g00epppbi9di9y****'),
  ioTCloudConnectorId?: [ string ](name='IoTCloudConnectorId'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model AddIoTCloudConnectorToGroupResponseBody = {
  requestId?: string(name='RequestId', example='cn-hangzhou'),
}

model AddIoTCloudConnectorToGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddIoTCloudConnectorToGroupResponseBody(name='body'),
}

async function addIoTCloudConnectorToGroupWithOptions(request: AddIoTCloudConnectorToGroupRequest, runtime: Util.RuntimeOptions): AddIoTCloudConnectorToGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorGroupId)) {
    query['IoTCloudConnectorGroupId'] = request.ioTCloudConnectorGroupId;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddIoTCloudConnectorToGroup',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addIoTCloudConnectorToGroup(request: AddIoTCloudConnectorToGroupRequest): AddIoTCloudConnectorToGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return addIoTCloudConnectorToGroupWithOptions(request, runtime);
}

model AssociateIpWithConnectionPoolRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  connectionPoolId?: string(name='ConnectionPoolId', example='cp-bp11234abctmno0hdq****'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  ips?: [ string ](name='Ips'),
  ipsFilePath?: string(name='IpsFilePath', example='cciot-cn-hangzhou/127859184306****/test.csv'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model AssociateIpWithConnectionPoolResponseBody = {
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model AssociateIpWithConnectionPoolResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AssociateIpWithConnectionPoolResponseBody(name='body'),
}

async function associateIpWithConnectionPoolWithOptions(request: AssociateIpWithConnectionPoolRequest, runtime: Util.RuntimeOptions): AssociateIpWithConnectionPoolResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.connectionPoolId)) {
    query['ConnectionPoolId'] = request.connectionPoolId;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.ips)) {
    query['Ips'] = request.ips;
  }
  if (!Util.isUnset(request.ipsFilePath)) {
    query['IpsFilePath'] = request.ipsFilePath;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AssociateIpWithConnectionPool',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function associateIpWithConnectionPool(request: AssociateIpWithConnectionPoolRequest): AssociateIpWithConnectionPoolResponse {
  var runtime = new Util.RuntimeOptions{};
  return associateIpWithConnectionPoolWithOptions(request, runtime);
}

model AssociateVSwitchWithIoTCloudConnectorRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  vSwitchList?: [ string ](name='VSwitchList'),
  vpcId?: string(name='VpcId', example='vpc-bp1aevy8sofi8mh1q****'),
}

model AssociateVSwitchWithIoTCloudConnectorResponseBody = {
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model AssociateVSwitchWithIoTCloudConnectorResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AssociateVSwitchWithIoTCloudConnectorResponseBody(name='body'),
}

async function associateVSwitchWithIoTCloudConnectorWithOptions(request: AssociateVSwitchWithIoTCloudConnectorRequest, runtime: Util.RuntimeOptions): AssociateVSwitchWithIoTCloudConnectorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.vSwitchList)) {
    query['VSwitchList'] = request.vSwitchList;
  }
  if (!Util.isUnset(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AssociateVSwitchWithIoTCloudConnector',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function associateVSwitchWithIoTCloudConnector(request: AssociateVSwitchWithIoTCloudConnectorRequest): AssociateVSwitchWithIoTCloudConnectorResponse {
  var runtime = new Util.RuntimeOptions{};
  return associateVSwitchWithIoTCloudConnectorWithOptions(request, runtime);
}

model ConfirmIoTCloudConnectorRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  confirmStatus?: string(name='ConfirmStatus', example='Confirm'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model ConfirmIoTCloudConnectorResponseBody = {
  requestId?: string(name='RequestId', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
  resourceId?: string(name='ResourceId', example='iotcc-bp1odcab8tmno0hdq****'),
}

model ConfirmIoTCloudConnectorResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ConfirmIoTCloudConnectorResponseBody(name='body'),
}

async function confirmIoTCloudConnectorWithOptions(request: ConfirmIoTCloudConnectorRequest, runtime: Util.RuntimeOptions): ConfirmIoTCloudConnectorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.confirmStatus)) {
    query['ConfirmStatus'] = request.confirmStatus;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ConfirmIoTCloudConnector',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function confirmIoTCloudConnector(request: ConfirmIoTCloudConnectorRequest): ConfirmIoTCloudConnectorResponse {
  var runtime = new Util.RuntimeOptions{};
  return confirmIoTCloudConnectorWithOptions(request, runtime);
}

model CreateAuthorizationRuleRequest {
  authorizationRuleDescription?: string(name='AuthorizationRuleDescription', example='rule01'),
  authorizationRuleName?: string(name='AuthorizationRuleName', example='rule01'),
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  destination?: string(name='Destination', example='47.0.XX.XX'),
  destinationPort?: string(name='DestinationPort', example='80/80'),
  destinationType?: string(name='DestinationType', example='Cidr'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  policy?: string(name='Policy', example='Permit'),
  protocol?: string(name='Protocol', example='tcp'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  sourceCidrs?: [ string ](name='SourceCidrs'),
}

model CreateAuthorizationRuleResponseBody = {
  authorizationRuleId?: string(name='AuthorizationRuleId', example='ar-1234abcb8tmno0hdq****'),
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model CreateAuthorizationRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateAuthorizationRuleResponseBody(name='body'),
}

async function createAuthorizationRuleWithOptions(request: CreateAuthorizationRuleRequest, runtime: Util.RuntimeOptions): CreateAuthorizationRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authorizationRuleDescription)) {
    query['AuthorizationRuleDescription'] = request.authorizationRuleDescription;
  }
  if (!Util.isUnset(request.authorizationRuleName)) {
    query['AuthorizationRuleName'] = request.authorizationRuleName;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.destination)) {
    query['Destination'] = request.destination;
  }
  if (!Util.isUnset(request.destinationPort)) {
    query['DestinationPort'] = request.destinationPort;
  }
  if (!Util.isUnset(request.destinationType)) {
    query['DestinationType'] = request.destinationType;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.policy)) {
    query['Policy'] = request.policy;
  }
  if (!Util.isUnset(request.protocol)) {
    query['Protocol'] = request.protocol;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.sourceCidrs)) {
    query['SourceCidrs'] = request.sourceCidrs;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAuthorizationRule',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createAuthorizationRule(request: CreateAuthorizationRuleRequest): CreateAuthorizationRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAuthorizationRuleWithOptions(request, runtime);
}

model CreateAuthorizationRulesRequest {
  authorizationRules?: [ 
    {
      description?: string(name='Description', example='rule01'),
      destination?: string(name='Destination', example='47.0.XX.XX'),
      destinationPort?: string(name='DestinationPort', example='80/80'),
      destinationType?: string(name='DestinationType', example='Cidr'),
      name?: string(name='Name', example='rule01'),
      policy?: string(name='Policy', example='Permit'),
      protocol?: string(name='Protocol', example='TCP'),
      sourceCidr?: string(name='SourceCidr', example='192.168.0.1/24'),
    }
  ](name='AuthorizationRules'),
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotccg-g00epppbi9di9y****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model CreateAuthorizationRulesResponseBody = {
  authorizationRuleIds?: [ string ](name='AuthorizationRuleIds'),
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model CreateAuthorizationRulesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateAuthorizationRulesResponseBody(name='body'),
}

async function createAuthorizationRulesWithOptions(request: CreateAuthorizationRulesRequest, runtime: Util.RuntimeOptions): CreateAuthorizationRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authorizationRules)) {
    query['AuthorizationRules'] = request.authorizationRules;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAuthorizationRules',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createAuthorizationRules(request: CreateAuthorizationRulesRequest): CreateAuthorizationRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAuthorizationRulesWithOptions(request, runtime);
}

model CreateConnectionPoolRequest {
  cidrs?: [ string ](name='Cidrs'),
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  connectionPoolDescription?: string(name='ConnectionPoolDescription', example='pool01'),
  connectionPoolName?: string(name='ConnectionPoolName', example='pool01'),
  count?: long(name='Count', example='2'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model CreateConnectionPoolResponseBody = {
  connectionPoolId?: string(name='ConnectionPoolId', example='cp-bp11234abctmno0hdq****'),
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model CreateConnectionPoolResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateConnectionPoolResponseBody(name='body'),
}

async function createConnectionPoolWithOptions(request: CreateConnectionPoolRequest, runtime: Util.RuntimeOptions): CreateConnectionPoolResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.cidrs)) {
    query['Cidrs'] = request.cidrs;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.connectionPoolDescription)) {
    query['ConnectionPoolDescription'] = request.connectionPoolDescription;
  }
  if (!Util.isUnset(request.connectionPoolName)) {
    query['ConnectionPoolName'] = request.connectionPoolName;
  }
  if (!Util.isUnset(request.count)) {
    query['Count'] = request.count;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateConnectionPool',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createConnectionPool(request: CreateConnectionPoolRequest): CreateConnectionPoolResponse {
  var runtime = new Util.RuntimeOptions{};
  return createConnectionPoolWithOptions(request, runtime);
}

model CreateDNSServiceRuleRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  DNSServiceRuleDescription?: string(name='DNSServiceRuleDescription', example='description'),
  DNSServiceRuleName?: string(name='DNSServiceRuleName', example='test'),
  destination?: string(name='Destination', example='192.168.0.2'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-1y6h8z7imd2yu4****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  serviceType?: string(name='ServiceType', example='Normal'),
  source?: string(name='Source', example='100.100.2.138'),
}

model CreateDNSServiceRuleResponseBody = {
  DNSServiceRuleId?: string(name='DNSServiceRuleId', example='ar-r56ijpurlu50gi****'),
  requestId?: string(name='RequestId', example='BC6D1C1D-6DBD-568C-B867-BC9CA699ED01'),
}

model CreateDNSServiceRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateDNSServiceRuleResponseBody(name='body'),
}

async function createDNSServiceRuleWithOptions(request: CreateDNSServiceRuleRequest, runtime: Util.RuntimeOptions): CreateDNSServiceRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.DNSServiceRuleDescription)) {
    query['DNSServiceRuleDescription'] = request.DNSServiceRuleDescription;
  }
  if (!Util.isUnset(request.DNSServiceRuleName)) {
    query['DNSServiceRuleName'] = request.DNSServiceRuleName;
  }
  if (!Util.isUnset(request.destination)) {
    query['Destination'] = request.destination;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.serviceType)) {
    query['ServiceType'] = request.serviceType;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateDNSServiceRule',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createDNSServiceRule(request: CreateDNSServiceRuleRequest): CreateDNSServiceRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDNSServiceRuleWithOptions(request, runtime);
}

model CreateGroupAuthorizationRuleRequest {
  authorizationRuleDescription?: string(name='AuthorizationRuleDescription', example='rule'),
  authorizationRuleName?: string(name='AuthorizationRuleName', example='ruletest'),
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  destination?: string(name='Destination', example='47.0.XX.XX'),
  destinationPort?: string(name='DestinationPort', example='80/80'),
  destinationType?: string(name='DestinationType', example='Cidr'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorGroupId?: string(name='IoTCloudConnectorGroupId', example='iotccg-g00epppbi9di9y****'),
  policy?: string(name='Policy', example='Permit'),
  protocol?: string(name='Protocol', example='tcp'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  sourceCidrs?: [ string ](name='SourceCidrs'),
  type?: string(name='Type', example='System'),
}

model CreateGroupAuthorizationRuleResponseBody = {
  authorizationRuleId?: string(name='AuthorizationRuleId', example='gar-ez91t41jvi6tr8****'),
  ioTCloudConnectorGroupId?: string(name='IoTCloudConnectorGroupId', example='iotccg-g00epppbi9di9y****'),
  requestId?: string(name='RequestId', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
}

model CreateGroupAuthorizationRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateGroupAuthorizationRuleResponseBody(name='body'),
}

async function createGroupAuthorizationRuleWithOptions(request: CreateGroupAuthorizationRuleRequest, runtime: Util.RuntimeOptions): CreateGroupAuthorizationRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authorizationRuleDescription)) {
    query['AuthorizationRuleDescription'] = request.authorizationRuleDescription;
  }
  if (!Util.isUnset(request.authorizationRuleName)) {
    query['AuthorizationRuleName'] = request.authorizationRuleName;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.destination)) {
    query['Destination'] = request.destination;
  }
  if (!Util.isUnset(request.destinationPort)) {
    query['DestinationPort'] = request.destinationPort;
  }
  if (!Util.isUnset(request.destinationType)) {
    query['DestinationType'] = request.destinationType;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorGroupId)) {
    query['IoTCloudConnectorGroupId'] = request.ioTCloudConnectorGroupId;
  }
  if (!Util.isUnset(request.policy)) {
    query['Policy'] = request.policy;
  }
  if (!Util.isUnset(request.protocol)) {
    query['Protocol'] = request.protocol;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.sourceCidrs)) {
    query['SourceCidrs'] = request.sourceCidrs;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateGroupAuthorizationRule',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createGroupAuthorizationRule(request: CreateGroupAuthorizationRuleRequest): CreateGroupAuthorizationRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return createGroupAuthorizationRuleWithOptions(request, runtime);
}

model CreateGroupDNSServiceRuleRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  DNSServiceRuleDescription?: string(name='DNSServiceRuleDescription', example='description'),
  DNSServiceRuleName?: string(name='DNSServiceRuleName', example='test'),
  destination?: string(name='Destination', example='192.168.0.2'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorGroupId?: string(name='IoTCloudConnectorGroupId', example='iotccg-g00epppbi9di9y****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  serviceType?: string(name='ServiceType', example='Normal'),
  source?: string(name='Source', example='100.100.2.136'),
}

model CreateGroupDNSServiceRuleResponseBody = {
  DNSServiceRuleId?: string(name='DNSServiceRuleId', example='gar-ffnn1ewe2nmf3y****'),
  ioTCloudConnectorGroupId?: string(name='IoTCloudConnectorGroupId', example='iotccg-g00epppbi9di9y****'),
  requestId?: string(name='RequestId', example='77111A6A-56BA-59B2-8CAA-7CBF21648FB8'),
}

model CreateGroupDNSServiceRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateGroupDNSServiceRuleResponseBody(name='body'),
}

async function createGroupDNSServiceRuleWithOptions(request: CreateGroupDNSServiceRuleRequest, runtime: Util.RuntimeOptions): CreateGroupDNSServiceRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.DNSServiceRuleDescription)) {
    query['DNSServiceRuleDescription'] = request.DNSServiceRuleDescription;
  }
  if (!Util.isUnset(request.DNSServiceRuleName)) {
    query['DNSServiceRuleName'] = request.DNSServiceRuleName;
  }
  if (!Util.isUnset(request.destination)) {
    query['Destination'] = request.destination;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorGroupId)) {
    query['IoTCloudConnectorGroupId'] = request.ioTCloudConnectorGroupId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.serviceType)) {
    query['ServiceType'] = request.serviceType;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateGroupDNSServiceRule',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createGroupDNSServiceRule(request: CreateGroupDNSServiceRuleRequest): CreateGroupDNSServiceRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return createGroupDNSServiceRuleWithOptions(request, runtime);
}

model CreateGroupIpMappingRuleRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  destinationIp?: string(name='DestinationIp', example='192.168.10.8'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorGroupId?: string(name='IoTCloudConnectorGroupId', example='iotccg-g00epppbi9di9y****'),
  ipMappingRuleDescription?: string(name='IpMappingRuleDescription', example='description'),
  ipMappingRuleName?: string(name='IpMappingRuleName', example='name'),
  mappingIp?: string(name='MappingIp', example='47.0.XX.XX'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model CreateGroupIpMappingRuleResponseBody = {
  groupIpMappingRuleId?: string(name='GroupIpMappingRuleId', example='im-irrp3bzuu5nrbx****'),
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model CreateGroupIpMappingRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateGroupIpMappingRuleResponseBody(name='body'),
}

async function createGroupIpMappingRuleWithOptions(request: CreateGroupIpMappingRuleRequest, runtime: Util.RuntimeOptions): CreateGroupIpMappingRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.destinationIp)) {
    query['DestinationIp'] = request.destinationIp;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorGroupId)) {
    query['IoTCloudConnectorGroupId'] = request.ioTCloudConnectorGroupId;
  }
  if (!Util.isUnset(request.ipMappingRuleDescription)) {
    query['IpMappingRuleDescription'] = request.ipMappingRuleDescription;
  }
  if (!Util.isUnset(request.ipMappingRuleName)) {
    query['IpMappingRuleName'] = request.ipMappingRuleName;
  }
  if (!Util.isUnset(request.mappingIp)) {
    query['MappingIp'] = request.mappingIp;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateGroupIpMappingRule',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createGroupIpMappingRule(request: CreateGroupIpMappingRuleRequest): CreateGroupIpMappingRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return createGroupIpMappingRuleWithOptions(request, runtime);
}

model CreateIoTCloudConnectorRequest {
  APN?: string(name='APN', example='CMWAP'),
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ISP?: string(name='ISP', example='mobile'),
  ioTCloudConnectorDescription?: string(name='IoTCloudConnectorDescription', example='test'),
  ioTCloudConnectorName?: string(name='IoTCloudConnectorName', example='test'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceUid?: long(name='ResourceUid', example='132193271328****'),
  type?: string(name='Type', example='Standard'),
  wildcardDomainEnabled?: boolean(name='WildcardDomainEnabled', example='true', deprecated='true'),
}

model CreateIoTCloudConnectorResponseBody = {
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model CreateIoTCloudConnectorResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateIoTCloudConnectorResponseBody(name='body'),
}

async function createIoTCloudConnectorWithOptions(request: CreateIoTCloudConnectorRequest, runtime: Util.RuntimeOptions): CreateIoTCloudConnectorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.APN)) {
    query['APN'] = request.APN;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ISP)) {
    query['ISP'] = request.ISP;
  }
  if (!Util.isUnset(request.ioTCloudConnectorDescription)) {
    query['IoTCloudConnectorDescription'] = request.ioTCloudConnectorDescription;
  }
  if (!Util.isUnset(request.ioTCloudConnectorName)) {
    query['IoTCloudConnectorName'] = request.ioTCloudConnectorName;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceUid)) {
    query['ResourceUid'] = request.resourceUid;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  if (!Util.isUnset(request.wildcardDomainEnabled)) {
    query['WildcardDomainEnabled'] = request.wildcardDomainEnabled;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateIoTCloudConnector',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createIoTCloudConnector(request: CreateIoTCloudConnectorRequest): CreateIoTCloudConnectorResponse {
  var runtime = new Util.RuntimeOptions{};
  return createIoTCloudConnectorWithOptions(request, runtime);
}

model CreateIoTCloudConnectorBackhaulRouteRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model CreateIoTCloudConnectorBackhaulRouteResponseBody = {
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  requestId?: string(name='RequestId', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model CreateIoTCloudConnectorBackhaulRouteResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateIoTCloudConnectorBackhaulRouteResponseBody(name='body'),
}

async function createIoTCloudConnectorBackhaulRouteWithOptions(request: CreateIoTCloudConnectorBackhaulRouteRequest, runtime: Util.RuntimeOptions): CreateIoTCloudConnectorBackhaulRouteResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateIoTCloudConnectorBackhaulRoute',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createIoTCloudConnectorBackhaulRoute(request: CreateIoTCloudConnectorBackhaulRouteRequest): CreateIoTCloudConnectorBackhaulRouteResponse {
  var runtime = new Util.RuntimeOptions{};
  return createIoTCloudConnectorBackhaulRouteWithOptions(request, runtime);
}

model CreateIoTCloudConnectorGroupRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  description?: string(name='Description', example='test'),
  dryRun?: boolean(name='DryRun', example='false'),
  name?: string(name='Name', example='cctest'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  type?: string(name='Type', example='Standard'),
}

model CreateIoTCloudConnectorGroupResponseBody = {
  ioTCloudConnectorGroupId?: string(name='IoTCloudConnectorGroupId', example='iotccg-g00epppbi9di9y****'),
  requestId?: string(name='RequestId', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
}

model CreateIoTCloudConnectorGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateIoTCloudConnectorGroupResponseBody(name='body'),
}

async function createIoTCloudConnectorGroupWithOptions(request: CreateIoTCloudConnectorGroupRequest, runtime: Util.RuntimeOptions): CreateIoTCloudConnectorGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateIoTCloudConnectorGroup',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createIoTCloudConnectorGroup(request: CreateIoTCloudConnectorGroupRequest): CreateIoTCloudConnectorGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createIoTCloudConnectorGroupWithOptions(request, runtime);
}

model CreateIpMappingRuleRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  destinationIp?: string(name='DestinationIp', example='192.168.10.8'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  ipMappingRuleDescription?: string(name='IpMappingRuleDescription', example='description'),
  ipMappingRuleName?: string(name='IpMappingRuleName', example='name'),
  mappingIp?: string(name='MappingIp', example='47.0.XX.XX'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model CreateIpMappingRuleResponseBody = {
  ipMappingRuleId?: string(name='IpMappingRuleId', example='im-irrp3bzuu5nrbx****'),
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model CreateIpMappingRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateIpMappingRuleResponseBody(name='body'),
}

async function createIpMappingRuleWithOptions(request: CreateIpMappingRuleRequest, runtime: Util.RuntimeOptions): CreateIpMappingRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.destinationIp)) {
    query['DestinationIp'] = request.destinationIp;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.ipMappingRuleDescription)) {
    query['IpMappingRuleDescription'] = request.ipMappingRuleDescription;
  }
  if (!Util.isUnset(request.ipMappingRuleName)) {
    query['IpMappingRuleName'] = request.ipMappingRuleName;
  }
  if (!Util.isUnset(request.mappingIp)) {
    query['MappingIp'] = request.mappingIp;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateIpMappingRule',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createIpMappingRule(request: CreateIpMappingRuleRequest): CreateIpMappingRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return createIpMappingRuleWithOptions(request, runtime);
}

model CreateServiceRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  serviceDescription?: string(name='ServiceDescription', example='service_description'),
  serviceName?: string(name='ServiceName', example='service_name'),
}

model CreateServiceResponseBody = {
  requestId?: string(name='RequestId', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  serviceId?: string(name='ServiceId', example='c910061f-****-44e6-b659-***c'),
}

model CreateServiceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateServiceResponseBody(name='body'),
}

async function createServiceWithOptions(request: CreateServiceRequest, runtime: Util.RuntimeOptions): CreateServiceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.serviceDescription)) {
    query['ServiceDescription'] = request.serviceDescription;
  }
  if (!Util.isUnset(request.serviceName)) {
    query['ServiceName'] = request.serviceName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateService',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createService(request: CreateServiceRequest): CreateServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createServiceWithOptions(request, runtime);
}

model CreateServiceEntryRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  serviceEntryDescription?: string(name='ServiceEntryDescription', example='entry_description'),
  serviceEntryName?: string(name='ServiceEntryName', example='entry_name'),
  serviceId?: string(name='ServiceId', example='c910061f-****-44e6-b659-***c'),
  target?: string(name='Target', example='192.168.1.32/27'),
  targetType?: string(name='TargetType', example='Cidr'),
}

model CreateServiceEntryResponseBody = {
  requestId?: string(name='RequestId', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
  serviceEntryId?: string(name='ServiceEntryId', example='fwd-119smw5tkasdf****'),
}

model CreateServiceEntryResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateServiceEntryResponseBody(name='body'),
}

async function createServiceEntryWithOptions(request: CreateServiceEntryRequest, runtime: Util.RuntimeOptions): CreateServiceEntryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.serviceEntryDescription)) {
    query['ServiceEntryDescription'] = request.serviceEntryDescription;
  }
  if (!Util.isUnset(request.serviceEntryName)) {
    query['ServiceEntryName'] = request.serviceEntryName;
  }
  if (!Util.isUnset(request.serviceId)) {
    query['ServiceId'] = request.serviceId;
  }
  if (!Util.isUnset(request.target)) {
    query['Target'] = request.target;
  }
  if (!Util.isUnset(request.targetType)) {
    query['TargetType'] = request.targetType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateServiceEntry',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createServiceEntry(request: CreateServiceEntryRequest): CreateServiceEntryResponse {
  var runtime = new Util.RuntimeOptions{};
  return createServiceEntryWithOptions(request, runtime);
}

model DeleteAuthorizationRuleRequest {
  authorizationRuleId?: string(name='AuthorizationRuleId', example='ar-1234abcb8tmno0hdq****'),
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model DeleteAuthorizationRuleResponseBody = {
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model DeleteAuthorizationRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteAuthorizationRuleResponseBody(name='body'),
}

async function deleteAuthorizationRuleWithOptions(request: DeleteAuthorizationRuleRequest, runtime: Util.RuntimeOptions): DeleteAuthorizationRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authorizationRuleId)) {
    query['AuthorizationRuleId'] = request.authorizationRuleId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAuthorizationRule',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteAuthorizationRule(request: DeleteAuthorizationRuleRequest): DeleteAuthorizationRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAuthorizationRuleWithOptions(request, runtime);
}

model DeleteAuthorizationRulesRequest {
  authorizationRuleIds?: [ string ](name='AuthorizationRuleIds'),
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model DeleteAuthorizationRulesResponseBody = {
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model DeleteAuthorizationRulesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteAuthorizationRulesResponseBody(name='body'),
}

async function deleteAuthorizationRulesWithOptions(request: DeleteAuthorizationRulesRequest, runtime: Util.RuntimeOptions): DeleteAuthorizationRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authorizationRuleIds)) {
    query['AuthorizationRuleIds'] = request.authorizationRuleIds;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAuthorizationRules',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteAuthorizationRules(request: DeleteAuthorizationRulesRequest): DeleteAuthorizationRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAuthorizationRulesWithOptions(request, runtime);
}

model DeleteConnectionPoolRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  connectionPoolId?: string(name='ConnectionPoolId', example='1234abc'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model DeleteConnectionPoolResponseBody = {
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model DeleteConnectionPoolResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteConnectionPoolResponseBody(name='body'),
}

async function deleteConnectionPoolWithOptions(request: DeleteConnectionPoolRequest, runtime: Util.RuntimeOptions): DeleteConnectionPoolResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.connectionPoolId)) {
    query['ConnectionPoolId'] = request.connectionPoolId;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteConnectionPool',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteConnectionPool(request: DeleteConnectionPoolRequest): DeleteConnectionPoolResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteConnectionPoolWithOptions(request, runtime);
}

model DeleteDNSServiceRuleRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  DNSServiceRuleId?: string(name='DNSServiceRuleId', example='ar-r56ijpurlu50gi****'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-1y6h8z7imd2yu4****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model DeleteDNSServiceRuleResponseBody = {
  requestId?: string(name='RequestId', example='BC6D1C1D-6DBD-568C-B867-BC9CA699ED01'),
}

model DeleteDNSServiceRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteDNSServiceRuleResponseBody(name='body'),
}

async function deleteDNSServiceRuleWithOptions(request: DeleteDNSServiceRuleRequest, runtime: Util.RuntimeOptions): DeleteDNSServiceRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.DNSServiceRuleId)) {
    query['DNSServiceRuleId'] = request.DNSServiceRuleId;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDNSServiceRule',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteDNSServiceRule(request: DeleteDNSServiceRuleRequest): DeleteDNSServiceRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDNSServiceRuleWithOptions(request, runtime);
}

model DeleteGroupAuthorizationRuleRequest {
  authorizationRuleId?: string(name='AuthorizationRuleId', example='gar-ez91t41jvi6tr8****'),
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='true'),
  ioTCloudConnectorGroupId?: string(name='IoTCloudConnectorGroupId', example='iotccg-g00epppbi9di9y****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model DeleteGroupAuthorizationRuleResponseBody = {
  requestId?: string(name='RequestId', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
}

model DeleteGroupAuthorizationRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteGroupAuthorizationRuleResponseBody(name='body'),
}

async function deleteGroupAuthorizationRuleWithOptions(request: DeleteGroupAuthorizationRuleRequest, runtime: Util.RuntimeOptions): DeleteGroupAuthorizationRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authorizationRuleId)) {
    query['AuthorizationRuleId'] = request.authorizationRuleId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorGroupId)) {
    query['IoTCloudConnectorGroupId'] = request.ioTCloudConnectorGroupId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteGroupAuthorizationRule',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteGroupAuthorizationRule(request: DeleteGroupAuthorizationRuleRequest): DeleteGroupAuthorizationRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteGroupAuthorizationRuleWithOptions(request, runtime);
}

model DeleteGroupDNSServiceRuleRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  DNSServiceRuleId?: string(name='DNSServiceRuleId', example='gar-ffnn1ewe2nmf3y****'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorGroupId?: string(name='IoTCloudConnectorGroupId', example='iotccg-g00epppbi9di9y****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model DeleteGroupDNSServiceRuleResponseBody = {
  requestId?: string(name='RequestId', example='77111A6A-56BA-59B2-8CAA-7CBF21648FB8'),
}

model DeleteGroupDNSServiceRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteGroupDNSServiceRuleResponseBody(name='body'),
}

async function deleteGroupDNSServiceRuleWithOptions(request: DeleteGroupDNSServiceRuleRequest, runtime: Util.RuntimeOptions): DeleteGroupDNSServiceRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.DNSServiceRuleId)) {
    query['DNSServiceRuleId'] = request.DNSServiceRuleId;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorGroupId)) {
    query['IoTCloudConnectorGroupId'] = request.ioTCloudConnectorGroupId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteGroupDNSServiceRule',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteGroupDNSServiceRule(request: DeleteGroupDNSServiceRuleRequest): DeleteGroupDNSServiceRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteGroupDNSServiceRuleWithOptions(request, runtime);
}

model DeleteGroupIpMappingRuleRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  groupIpMappingRuleId?: string(name='GroupIpMappingRuleId', example='im-irrp3bzuu5nrbx****'),
  ioTCloudConnectorGroupId?: string(name='IoTCloudConnectorGroupId', example='iotccg-g00epppbi9di9y****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model DeleteGroupIpMappingRuleResponseBody = {
  requestId?: string(name='RequestId', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model DeleteGroupIpMappingRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteGroupIpMappingRuleResponseBody(name='body'),
}

async function deleteGroupIpMappingRuleWithOptions(request: DeleteGroupIpMappingRuleRequest, runtime: Util.RuntimeOptions): DeleteGroupIpMappingRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.groupIpMappingRuleId)) {
    query['GroupIpMappingRuleId'] = request.groupIpMappingRuleId;
  }
  if (!Util.isUnset(request.ioTCloudConnectorGroupId)) {
    query['IoTCloudConnectorGroupId'] = request.ioTCloudConnectorGroupId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteGroupIpMappingRule',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteGroupIpMappingRule(request: DeleteGroupIpMappingRuleRequest): DeleteGroupIpMappingRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteGroupIpMappingRuleWithOptions(request, runtime);
}

model DeleteIoTCloudConnectorRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model DeleteIoTCloudConnectorResponseBody = {
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model DeleteIoTCloudConnectorResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteIoTCloudConnectorResponseBody(name='body'),
}

async function deleteIoTCloudConnectorWithOptions(request: DeleteIoTCloudConnectorRequest, runtime: Util.RuntimeOptions): DeleteIoTCloudConnectorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteIoTCloudConnector',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteIoTCloudConnector(request: DeleteIoTCloudConnectorRequest): DeleteIoTCloudConnectorResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteIoTCloudConnectorWithOptions(request, runtime);
}

model DeleteIoTCloudConnectorGroupRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='true'),
  ioTCloudConnectorGroupId?: string(name='IoTCloudConnectorGroupId', example='iotccg-g00epppbi9di9y****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model DeleteIoTCloudConnectorGroupResponseBody = {
  requestId?: string(name='RequestId', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
}

model DeleteIoTCloudConnectorGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteIoTCloudConnectorGroupResponseBody(name='body'),
}

async function deleteIoTCloudConnectorGroupWithOptions(request: DeleteIoTCloudConnectorGroupRequest, runtime: Util.RuntimeOptions): DeleteIoTCloudConnectorGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorGroupId)) {
    query['IoTCloudConnectorGroupId'] = request.ioTCloudConnectorGroupId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteIoTCloudConnectorGroup',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteIoTCloudConnectorGroup(request: DeleteIoTCloudConnectorGroupRequest): DeleteIoTCloudConnectorGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteIoTCloudConnectorGroupWithOptions(request, runtime);
}

model DeleteIoTCloudConnetorBackhaulRouteRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model DeleteIoTCloudConnetorBackhaulRouteResponseBody = {
  requestId?: string(name='RequestId', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model DeleteIoTCloudConnetorBackhaulRouteResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteIoTCloudConnetorBackhaulRouteResponseBody(name='body'),
}

async function deleteIoTCloudConnetorBackhaulRouteWithOptions(request: DeleteIoTCloudConnetorBackhaulRouteRequest, runtime: Util.RuntimeOptions): DeleteIoTCloudConnetorBackhaulRouteResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteIoTCloudConnetorBackhaulRoute',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteIoTCloudConnetorBackhaulRoute(request: DeleteIoTCloudConnetorBackhaulRouteRequest): DeleteIoTCloudConnetorBackhaulRouteResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteIoTCloudConnetorBackhaulRouteWithOptions(request, runtime);
}

model DeleteIpMappingRuleRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  ipMappingRuleId?: string(name='IpMappingRuleId', example='im-irrp3bzuu5nrbx****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model DeleteIpMappingRuleResponseBody = {
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model DeleteIpMappingRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteIpMappingRuleResponseBody(name='body'),
}

async function deleteIpMappingRuleWithOptions(request: DeleteIpMappingRuleRequest, runtime: Util.RuntimeOptions): DeleteIpMappingRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.ipMappingRuleId)) {
    query['IpMappingRuleId'] = request.ipMappingRuleId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteIpMappingRule',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteIpMappingRule(request: DeleteIpMappingRuleRequest): DeleteIpMappingRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteIpMappingRuleWithOptions(request, runtime);
}

model DeleteServiceRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  serviceId?: string(name='ServiceId', example='c910061f-****-44e6-b659-***c'),
}

model DeleteServiceResponseBody = {
  requestId?: string(name='RequestId', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model DeleteServiceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteServiceResponseBody(name='body'),
}

async function deleteServiceWithOptions(request: DeleteServiceRequest, runtime: Util.RuntimeOptions): DeleteServiceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.serviceId)) {
    query['ServiceId'] = request.serviceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteService',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteService(request: DeleteServiceRequest): DeleteServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteServiceWithOptions(request, runtime);
}

model DeleteServiceEntryRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  serviceEntryId?: string(name='ServiceEntryId', example='fwd-119smw5tkasdf****'),
  serviceId?: string(name='ServiceId', example='c910061f-****-44e6-b659-***c'),
}

model DeleteServiceEntryResponseBody = {
  requestId?: string(name='RequestId', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
}

model DeleteServiceEntryResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteServiceEntryResponseBody(name='body'),
}

async function deleteServiceEntryWithOptions(request: DeleteServiceEntryRequest, runtime: Util.RuntimeOptions): DeleteServiceEntryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.serviceEntryId)) {
    query['ServiceEntryId'] = request.serviceEntryId;
  }
  if (!Util.isUnset(request.serviceId)) {
    query['ServiceId'] = request.serviceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteServiceEntry',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteServiceEntry(request: DeleteServiceEntryRequest): DeleteServiceEntryResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteServiceEntryWithOptions(request, runtime);
}

model DisableIoTCloudConnectorAccessLogRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model DisableIoTCloudConnectorAccessLogResponseBody = {
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model DisableIoTCloudConnectorAccessLogResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DisableIoTCloudConnectorAccessLogResponseBody(name='body'),
}

async function disableIoTCloudConnectorAccessLogWithOptions(request: DisableIoTCloudConnectorAccessLogRequest, runtime: Util.RuntimeOptions): DisableIoTCloudConnectorAccessLogResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableIoTCloudConnectorAccessLog',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function disableIoTCloudConnectorAccessLog(request: DisableIoTCloudConnectorAccessLogRequest): DisableIoTCloudConnectorAccessLogResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableIoTCloudConnectorAccessLogWithOptions(request, runtime);
}

model DissociateIpFromConnectionPoolRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  connectionPoolId?: string(name='ConnectionPoolId', example='cp-bp11234abctmno0hdq****'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  ips?: [ string ](name='Ips'),
  ipsFilePath?: string(name='IpsFilePath', example='cciot-cn-hangzhou/127859184306****/test.csv'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model DissociateIpFromConnectionPoolResponseBody = {
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model DissociateIpFromConnectionPoolResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DissociateIpFromConnectionPoolResponseBody(name='body'),
}

async function dissociateIpFromConnectionPoolWithOptions(request: DissociateIpFromConnectionPoolRequest, runtime: Util.RuntimeOptions): DissociateIpFromConnectionPoolResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.connectionPoolId)) {
    query['ConnectionPoolId'] = request.connectionPoolId;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.ips)) {
    query['Ips'] = request.ips;
  }
  if (!Util.isUnset(request.ipsFilePath)) {
    query['IpsFilePath'] = request.ipsFilePath;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DissociateIpFromConnectionPool',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function dissociateIpFromConnectionPool(request: DissociateIpFromConnectionPoolRequest): DissociateIpFromConnectionPoolResponse {
  var runtime = new Util.RuntimeOptions{};
  return dissociateIpFromConnectionPoolWithOptions(request, runtime);
}

model DissociateVSwitchFromIoTCloudConnectorRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model DissociateVSwitchFromIoTCloudConnectorResponseBody = {
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model DissociateVSwitchFromIoTCloudConnectorResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DissociateVSwitchFromIoTCloudConnectorResponseBody(name='body'),
}

async function dissociateVSwitchFromIoTCloudConnectorWithOptions(request: DissociateVSwitchFromIoTCloudConnectorRequest, runtime: Util.RuntimeOptions): DissociateVSwitchFromIoTCloudConnectorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DissociateVSwitchFromIoTCloudConnector',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function dissociateVSwitchFromIoTCloudConnector(request: DissociateVSwitchFromIoTCloudConnectorRequest): DissociateVSwitchFromIoTCloudConnectorResponse {
  var runtime = new Util.RuntimeOptions{};
  return dissociateVSwitchFromIoTCloudConnectorWithOptions(request, runtime);
}

model EnableIoTCloudConnectorAccessLogRequest {
  accessLogSlsLogStore?: string(name='AccessLogSlsLogStore', example='test'),
  accessLogSlsProject?: string(name='AccessLogSlsProject', example='sls-setter'),
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model EnableIoTCloudConnectorAccessLogResponseBody = {
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model EnableIoTCloudConnectorAccessLogResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: EnableIoTCloudConnectorAccessLogResponseBody(name='body'),
}

async function enableIoTCloudConnectorAccessLogWithOptions(request: EnableIoTCloudConnectorAccessLogRequest, runtime: Util.RuntimeOptions): EnableIoTCloudConnectorAccessLogResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accessLogSlsLogStore)) {
    query['AccessLogSlsLogStore'] = request.accessLogSlsLogStore;
  }
  if (!Util.isUnset(request.accessLogSlsProject)) {
    query['AccessLogSlsProject'] = request.accessLogSlsProject;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableIoTCloudConnectorAccessLog',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function enableIoTCloudConnectorAccessLog(request: EnableIoTCloudConnectorAccessLogRequest): EnableIoTCloudConnectorAccessLogResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableIoTCloudConnectorAccessLogWithOptions(request, runtime);
}

model GetConnectionPoolIpOperationResultRequest {
  connectionPoolId?: string(name='ConnectionPoolId', example='cp-0gd9qnmv8431rh****'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  queryRequestId?: string(name='QueryRequestId', example='CFA63CEB-15B6-4AE8-B203-F855FF7BA962'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model GetConnectionPoolIpOperationResultResponseBody = {
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA651'),
  resultFilePaths?: [ string ](name='ResultFilePaths'),
}

model GetConnectionPoolIpOperationResultResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetConnectionPoolIpOperationResultResponseBody(name='body'),
}

async function getConnectionPoolIpOperationResultWithOptions(request: GetConnectionPoolIpOperationResultRequest, runtime: Util.RuntimeOptions): GetConnectionPoolIpOperationResultResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.connectionPoolId)) {
    query['ConnectionPoolId'] = request.connectionPoolId;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.queryRequestId)) {
    query['QueryRequestId'] = request.queryRequestId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetConnectionPoolIpOperationResult',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getConnectionPoolIpOperationResult(request: GetConnectionPoolIpOperationResultRequest): GetConnectionPoolIpOperationResultResponse {
  var runtime = new Util.RuntimeOptions{};
  return getConnectionPoolIpOperationResultWithOptions(request, runtime);
}

model GetDiagnoseResultForSingleCardRequest {
  diagnoseTaskId?: string(name='DiagnoseTaskId', example='diagnoseTask-bp2qhwdp2n9x6zkvq****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model GetDiagnoseResultForSingleCardResponseBody = {
  beginTime?: long(name='BeginTime', example='1643077466'),
  cardIp?: string(name='CardIp', example='169.254.XX.XX'),
  destination?: string(name='Destination', example='114.114.XX.XX'),
  diagnoseItem?: [ 
    {
      part?: string(name='Part', example='Terminal'),
      status?: string(name='Status', example='Normal'),
    }
  ](name='DiagnoseItem'),
  endTime?: long(name='EndTime', example='1643077666'),
  errorResult?: [ 
    {
      errorDesc?: string(name='ErrorDesc', example='Terminal abnormal'),
      errorLevel?: string(name='ErrorLevel', example='Warning'),
      errorPart?: string(name='ErrorPart', example='Terminal'),
      errorSuggestion?: string(name='ErrorSuggestion', example='Please check whether the terminal and card are compatible or whether the terminal can send messages'),
    }
  ](name='ErrorResult'),
  iccId?: string(name='IccId', example='89860477*******27546'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-smy9a5ockzp08n****'),
  requestId?: string(name='RequestId', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
  status?: string(name='Status', example='failed'),
}

model GetDiagnoseResultForSingleCardResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetDiagnoseResultForSingleCardResponseBody(name='body'),
}

async function getDiagnoseResultForSingleCardWithOptions(request: GetDiagnoseResultForSingleCardRequest, runtime: Util.RuntimeOptions): GetDiagnoseResultForSingleCardResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.diagnoseTaskId)) {
    query['DiagnoseTaskId'] = request.diagnoseTaskId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDiagnoseResultForSingleCard',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getDiagnoseResultForSingleCard(request: GetDiagnoseResultForSingleCardRequest): GetDiagnoseResultForSingleCardResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDiagnoseResultForSingleCardWithOptions(request, runtime);
}

model GetIoTCloudConnectorAccessLogRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model GetIoTCloudConnectorAccessLogResponseBody = {
  accessLogSlsLogStore?: string(name='AccessLogSlsLogStore', example='test'),
  accessLogSlsProject?: string(name='AccessLogSlsProject', example='sls-setter'),
  accessLogStatus?: string(name='AccessLogStatus', example='Opened'),
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model GetIoTCloudConnectorAccessLogResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetIoTCloudConnectorAccessLogResponseBody(name='body'),
}

async function getIoTCloudConnectorAccessLogWithOptions(request: GetIoTCloudConnectorAccessLogRequest, runtime: Util.RuntimeOptions): GetIoTCloudConnectorAccessLogResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetIoTCloudConnectorAccessLog',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getIoTCloudConnectorAccessLog(request: GetIoTCloudConnectorAccessLogRequest): GetIoTCloudConnectorAccessLogResponse {
  var runtime = new Util.RuntimeOptions{};
  return getIoTCloudConnectorAccessLogWithOptions(request, runtime);
}

model GetStsInfoAndOssPathRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  connectionPoolId?: string(name='ConnectionPoolId', example='cp-bp11234abctmno0hdq****'),
  dryRun?: boolean(name='DryRun', example='false'),
  fileName?: string(name='FileName', example='test.csv'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model GetStsInfoAndOssPathResponseBody = {
  accessKeyId?: string(name='AccessKeyId', example='<yourAccessKeyId>'),
  accessKeySecret?: string(name='AccessKeySecret', example='<yourAccessKeySecret>'),
  expiration?: string(name='Expiration', example='1633060876'),
  ossPath?: string(name='OssPath', example='cciot-cn-hangzhou/127859184306****/test.csv'),
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
  securityToken?: string(name='SecurityToken', example='<yourSecurityToken>'),
}

model GetStsInfoAndOssPathResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetStsInfoAndOssPathResponseBody(name='body'),
}

async function getStsInfoAndOssPathWithOptions(request: GetStsInfoAndOssPathRequest, runtime: Util.RuntimeOptions): GetStsInfoAndOssPathResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.connectionPoolId)) {
    query['ConnectionPoolId'] = request.connectionPoolId;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.fileName)) {
    query['FileName'] = request.fileName;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetStsInfoAndOssPath',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getStsInfoAndOssPath(request: GetStsInfoAndOssPathRequest): GetStsInfoAndOssPathResponse {
  var runtime = new Util.RuntimeOptions{};
  return getStsInfoAndOssPathWithOptions(request, runtime);
}

model GrantVirtualBorderRouterRequest {
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  virtualBorderRouterId?: string(name='VirtualBorderRouterId', example='vbr-bp1svadp4lq38janc****'),
}

model GrantVirtualBorderRouterResponseBody = {
  requestId?: string(name='RequestId', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
}

model GrantVirtualBorderRouterResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GrantVirtualBorderRouterResponseBody(name='body'),
}

async function grantVirtualBorderRouterWithOptions(request: GrantVirtualBorderRouterRequest, runtime: Util.RuntimeOptions): GrantVirtualBorderRouterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.virtualBorderRouterId)) {
    query['VirtualBorderRouterId'] = request.virtualBorderRouterId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GrantVirtualBorderRouter',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function grantVirtualBorderRouter(request: GrantVirtualBorderRouterRequest): GrantVirtualBorderRouterResponse {
  var runtime = new Util.RuntimeOptions{};
  return grantVirtualBorderRouterWithOptions(request, runtime);
}

model ListAPNsRequest {
  APN?: string(name='APN', example='CMWAP'),
  ISP?: string(name='ISP', example='mobile'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  type?: string(name='Type', example='Standard'),
}

model ListAPNsResponseBody = {
  APNs?: [ 
    {
      APN?: string(name='APN', example='CMWAP'),
      description?: string(name='Description', example='test'),
      featureList?: [ string ](name='FeatureList'),
      ISP?: string(name='ISP', example='mobile'),
      name?: string(name='Name', example='test'),
      zoneList?: [ string ](name='ZoneList'),
    }
  ](name='APNs'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
  totalCount?: int32(name='TotalCount', example='1'),
}

model ListAPNsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListAPNsResponseBody(name='body'),
}

async function listAPNsWithOptions(request: ListAPNsRequest, runtime: Util.RuntimeOptions): ListAPNsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.APN)) {
    query['APN'] = request.APN;
  }
  if (!Util.isUnset(request.ISP)) {
    query['ISP'] = request.ISP;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAPNs',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listAPNs(request: ListAPNsRequest): ListAPNsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAPNsWithOptions(request, runtime);
}

model ListAuthorizationRulesRequest {
  authorizationRuleIds?: [ string ](name='AuthorizationRuleIds'),
  authorizationRuleName?: [ string ](name='AuthorizationRuleName'),
  authorizationRuleStatus?: [ string ](name='AuthorizationRuleStatus'),
  authorizationRuleType?: string(name='AuthorizationRuleType', example='System'),
  destination?: [ string ](name='Destination'),
  destinationPort?: [ string ](name='DestinationPort'),
  destinationType?: [ string ](name='DestinationType'),
  fuzzyAuthorizationRuleName?: string(name='FuzzyAuthorizationRuleName'),
  fuzzyDestination?: string(name='FuzzyDestination'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='caeba0bbb2be03f84eb48b699f0a****'),
  policy?: [ string ](name='Policy'),
  protocol?: [ string ](name='Protocol'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model ListAuthorizationRulesResponseBody = {
  authorizationRules?: [ 
    {
      authorizationRuleDescription?: string(name='AuthorizationRuleDescription', example='rule01'),
      authorizationRuleId?: string(name='AuthorizationRuleId', example='ar-1234abcb8tmno0hdq****'),
      authorizationRuleName?: string(name='AuthorizationRuleName', example='rule01'),
      authorizationRuleStatus?: string(name='AuthorizationRuleStatus', example='Created'),
      authorizationRuleType?: string(name='AuthorizationRuleType', example='System'),
      destination?: string(name='Destination', example='192.168.XX.XX'),
      destinationPort?: string(name='DestinationPort', example='80/80'),
      destinationType?: string(name='DestinationType', example='Cidr'),
      ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
      policy?: string(name='Policy', example='Permit'),
      protocol?: string(name='Protocol', example='tcp'),
      sourceCidrs?: [ string ](name='SourceCidrs'),
    }
  ](name='AuthorizationRules'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='caeba0bbb2be03f84eb48b699f0a****'),
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
  totalCount?: int32(name='TotalCount', example='10'),
}

model ListAuthorizationRulesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListAuthorizationRulesResponseBody(name='body'),
}

async function listAuthorizationRulesWithOptions(request: ListAuthorizationRulesRequest, runtime: Util.RuntimeOptions): ListAuthorizationRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authorizationRuleIds)) {
    query['AuthorizationRuleIds'] = request.authorizationRuleIds;
  }
  if (!Util.isUnset(request.authorizationRuleName)) {
    query['AuthorizationRuleName'] = request.authorizationRuleName;
  }
  if (!Util.isUnset(request.authorizationRuleStatus)) {
    query['AuthorizationRuleStatus'] = request.authorizationRuleStatus;
  }
  if (!Util.isUnset(request.authorizationRuleType)) {
    query['AuthorizationRuleType'] = request.authorizationRuleType;
  }
  if (!Util.isUnset(request.destination)) {
    query['Destination'] = request.destination;
  }
  if (!Util.isUnset(request.destinationPort)) {
    query['DestinationPort'] = request.destinationPort;
  }
  if (!Util.isUnset(request.destinationType)) {
    query['DestinationType'] = request.destinationType;
  }
  if (!Util.isUnset(request.fuzzyAuthorizationRuleName)) {
    query['FuzzyAuthorizationRuleName'] = request.fuzzyAuthorizationRuleName;
  }
  if (!Util.isUnset(request.fuzzyDestination)) {
    query['FuzzyDestination'] = request.fuzzyDestination;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.policy)) {
    query['Policy'] = request.policy;
  }
  if (!Util.isUnset(request.protocol)) {
    query['Protocol'] = request.protocol;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAuthorizationRules',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listAuthorizationRules(request: ListAuthorizationRulesRequest): ListAuthorizationRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAuthorizationRulesWithOptions(request, runtime);
}

model ListConnectionPoolAllIpsRequest {
  connectionPoolId?: string(name='ConnectionPoolId', example='cp-bp11234abctmno0hdq****'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  ip?: string(name='Ip', example='192.168.0.1'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  type?: string(name='Type', example='Cidr'),
}

model ListConnectionPoolAllIpsResponseBody = {
  connectionPoolIps?: [ 
    {
      connectionPoolId?: string(name='ConnectionPoolId', example='cp-bp11234abctmno0hdq****'),
      ip?: string(name='Ip', example='192.168.0.1'),
      ipNum?: long(name='IpNum', example='254'),
      status?: string(name='Status', example='activated'),
      type?: string(name='Type', example='Cidr'),
    }
  ](name='ConnectionPoolIps'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
  totalIpsCount?: int32(name='TotalIpsCount', example='1'),
}

model ListConnectionPoolAllIpsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListConnectionPoolAllIpsResponseBody(name='body'),
}

async function listConnectionPoolAllIpsWithOptions(request: ListConnectionPoolAllIpsRequest, runtime: Util.RuntimeOptions): ListConnectionPoolAllIpsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.connectionPoolId)) {
    query['ConnectionPoolId'] = request.connectionPoolId;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.ip)) {
    query['Ip'] = request.ip;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListConnectionPoolAllIps',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listConnectionPoolAllIps(request: ListConnectionPoolAllIpsRequest): ListConnectionPoolAllIpsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listConnectionPoolAllIpsWithOptions(request, runtime);
}

model ListConnectionPoolIpsRequest {
  connectionPoolId?: string(name='ConnectionPoolId', example='cp-bp11234abctmno0hdq****'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  ip?: string(name='Ip', example='192.168.XX.XX'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='caeba0bbb2be03f84eb48b699f0a****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model ListConnectionPoolIpsResponseBody = {
  connectionPoolIps?: [ 
    {
      connectionPoolId?: string(name='ConnectionPoolId', example='cp-bp11234abctmno0hdq****'),
      ip?: string(name='Ip', example='192.168.XX.XX'),
      status?: string(name='Status', example='activated'),
    }
  ](name='ConnectionPoolIps'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='caeba0bbb2be03f84eb48b699f0a****'),
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
  totalCount?: int32(name='TotalCount', example='2'),
}

model ListConnectionPoolIpsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListConnectionPoolIpsResponseBody(name='body'),
}

async function listConnectionPoolIpsWithOptions(request: ListConnectionPoolIpsRequest, runtime: Util.RuntimeOptions): ListConnectionPoolIpsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.connectionPoolId)) {
    query['ConnectionPoolId'] = request.connectionPoolId;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.ip)) {
    query['Ip'] = request.ip;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListConnectionPoolIps',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listConnectionPoolIps(request: ListConnectionPoolIpsRequest): ListConnectionPoolIpsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listConnectionPoolIpsWithOptions(request, runtime);
}

model ListConnectionPoolsRequest {
  connectionPoolIds?: [ string ](name='ConnectionPoolIds'),
  connectionPoolName?: [ string ](name='ConnectionPoolName'),
  connectionPoolStatus?: [ string ](name='ConnectionPoolStatus'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='caeba0bbb2be03f84eb48b699f0a****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model ListConnectionPoolsResponseBody = {
  connectionPools?: [ 
    {
      cidrs?: [ string ](name='Cidrs'),
      connectionPoolDescription?: string(name='ConnectionPoolDescription', example='pool01'),
      connectionPoolId?: string(name='ConnectionPoolId', example='cp-bp11234abctmno0hdq****'),
      connectionPoolName?: string(name='ConnectionPoolName', example='pool01'),
      connectionPoolStatus?: string(name='ConnectionPoolStatus', example='Running'),
      operateResultRequestID?: string(name='OperateResultRequestID', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA651'),
    }
  ](name='ConnectionPools'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='caeba0bbb2be03f84eb48b699f0a****'),
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
  totalCount?: int32(name='TotalCount', example='2'),
}

model ListConnectionPoolsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListConnectionPoolsResponseBody(name='body'),
}

async function listConnectionPoolsWithOptions(request: ListConnectionPoolsRequest, runtime: Util.RuntimeOptions): ListConnectionPoolsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.connectionPoolIds)) {
    query['ConnectionPoolIds'] = request.connectionPoolIds;
  }
  if (!Util.isUnset(request.connectionPoolName)) {
    query['ConnectionPoolName'] = request.connectionPoolName;
  }
  if (!Util.isUnset(request.connectionPoolStatus)) {
    query['ConnectionPoolStatus'] = request.connectionPoolStatus;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListConnectionPools',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listConnectionPools(request: ListConnectionPoolsRequest): ListConnectionPoolsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listConnectionPoolsWithOptions(request, runtime);
}

model ListDNSServiceRulesRequest {
  DNSServiceRuleIds?: [ string ](name='DNSServiceRuleIds'),
  DNSServiceRuleName?: [ string ](name='DNSServiceRuleName'),
  DNSServiceRuleStatus?: [ string ](name='DNSServiceRuleStatus'),
  destination?: [ string ](name='Destination'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-1y6h8z7imd2yu4****'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  serviceType?: string(name='ServiceType', example='Normal'),
  source?: [ string ](name='Source'),
}

model ListDNSServiceRulesResponseBody = {
  DNSServiceRules?: [ 
    {
      DNSServiceRuleDescription?: string(name='DNSServiceRuleDescription', example='description'),
      DNSServiceRuleId?: string(name='DNSServiceRuleId', example='ar-c1dk4jb73j5791****'),
      DNSServiceRuleName?: string(name='DNSServiceRuleName', example='test'),
      DNSServiceRuleStatus?: string(name='DNSServiceRuleStatus', example='Created'),
      destination?: string(name='Destination', example='192.168.0.2'),
      ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-1y6h8z7imd2yu4****'),
      serviceType?: string(name='ServiceType', example='Normal'),
      source?: string(name='Source', example='100.100.2.138'),
    }
  ](name='DNSServiceRules'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', example='4A63118E-B375-5718-8F03-30F6804E1DCD'),
  totalCount?: int32(name='TotalCount', example='10'),
}

model ListDNSServiceRulesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListDNSServiceRulesResponseBody(name='body'),
}

async function listDNSServiceRulesWithOptions(request: ListDNSServiceRulesRequest, runtime: Util.RuntimeOptions): ListDNSServiceRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DNSServiceRuleIds)) {
    query['DNSServiceRuleIds'] = request.DNSServiceRuleIds;
  }
  if (!Util.isUnset(request.DNSServiceRuleName)) {
    query['DNSServiceRuleName'] = request.DNSServiceRuleName;
  }
  if (!Util.isUnset(request.DNSServiceRuleStatus)) {
    query['DNSServiceRuleStatus'] = request.DNSServiceRuleStatus;
  }
  if (!Util.isUnset(request.destination)) {
    query['Destination'] = request.destination;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.serviceType)) {
    query['ServiceType'] = request.serviceType;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListDNSServiceRules',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listDNSServiceRules(request: ListDNSServiceRulesRequest): ListDNSServiceRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listDNSServiceRulesWithOptions(request, runtime);
}

model ListDiagnoseInfoForSingleCardRequest {
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-smy9a5ockzp08n****'),
  maxResults?: int32(name='MaxResults', example='20'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  source?: string(name='Source', example='169.254.XX.XX'),
  sourceType?: string(name='SourceType'),
}

model ListDiagnoseInfoForSingleCardResponseBody = {
  diagnoseInfo?: [ 
    {
      beginTime?: long(name='BeginTime', example='1643077466'),
      cardIp?: string(name='CardIp', example='169.254.XX.XX'),
      destination?: string(name='Destination', example='114.114.XX.XX'),
      destinationType?: string(name='DestinationType', example='IP'),
      diagnoseTime?: long(name='DiagnoseTime', example='1649669904'),
      endTime?: long(name='EndTime', example='1643077666'),
      iccId?: string(name='IccId', example='89860477*******27546'),
      ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-smy9a5ockzp08n****'),
      source?: string(name='Source', example='169.254.XX.XX'),
      sourceType?: string(name='SourceType'),
      status?: string(name='Status', example='completed'),
      taskId?: string(name='TaskId', example='diagnoseTask-bp2qhwdp2n9x6zkvq****'),
    }
  ](name='DiagnoseInfo'),
  maxResults?: long(name='MaxResults', example='20'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
  totalCount?: long(name='TotalCount', example='10'),
}

model ListDiagnoseInfoForSingleCardResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListDiagnoseInfoForSingleCardResponseBody(name='body'),
}

async function listDiagnoseInfoForSingleCardWithOptions(request: ListDiagnoseInfoForSingleCardRequest, runtime: Util.RuntimeOptions): ListDiagnoseInfoForSingleCardResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  if (!Util.isUnset(request.sourceType)) {
    query['SourceType'] = request.sourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListDiagnoseInfoForSingleCard',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listDiagnoseInfoForSingleCard(request: ListDiagnoseInfoForSingleCardRequest): ListDiagnoseInfoForSingleCardResponse {
  var runtime = new Util.RuntimeOptions{};
  return listDiagnoseInfoForSingleCardWithOptions(request, runtime);
}

model ListGroupAuthorizationRulesRequest {
  authorizationRuleIds?: [ string ](name='AuthorizationRuleIds'),
  authorizationRuleName?: [ string ](name='AuthorizationRuleName'),
  authorizationRuleStatus?: [ string ](name='AuthorizationRuleStatus'),
  destination?: [ string ](name='Destination'),
  destinationPort?: [ string ](name='DestinationPort'),
  destinationType?: [ string ](name='DestinationType'),
  ioTCloudConnectorGroupId?: string(name='IoTCloudConnectorGroupId', example='iotccg-g00epppbi9di9y****'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  policy?: [ string ](name='Policy'),
  protocol?: [ string ](name='Protocol'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  type?: string(name='Type', example='System'),
}

model ListGroupAuthorizationRulesResponseBody = {
  groupAuthorizationRules?: [ 
    {
      authorizationRuleDescription?: string(name='AuthorizationRuleDescription', example='rule'),
      authorizationRuleId?: string(name='AuthorizationRuleId', example='gar-ez91t41jvi6tr8****'),
      authorizationRuleName?: string(name='AuthorizationRuleName', example='ruletest'),
      authorizationRuleStatus?: string(name='AuthorizationRuleStatus', example='Created'),
      destination?: string(name='Destination', example='47.0.XX.XX'),
      destinationPort?: string(name='DestinationPort', example='80/80'),
      destinationType?: string(name='DestinationType', example='Cidr'),
      ioTCloudConnectorGroupId?: string(name='IoTCloudConnectorGroupId', example='iotccg-g00epppbi9di9y****'),
      policy?: string(name='Policy', example='Permit'),
      protocol?: string(name='Protocol', example='tcp'),
      sourceCidrs?: [ string ](name='SourceCidrs'),
      type?: string(name='Type', example='System'),
    }
  ](name='GroupAuthorizationRules'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
  totalCount?: int32(name='TotalCount', example='10'),
}

model ListGroupAuthorizationRulesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListGroupAuthorizationRulesResponseBody(name='body'),
}

async function listGroupAuthorizationRulesWithOptions(request: ListGroupAuthorizationRulesRequest, runtime: Util.RuntimeOptions): ListGroupAuthorizationRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authorizationRuleIds)) {
    query['AuthorizationRuleIds'] = request.authorizationRuleIds;
  }
  if (!Util.isUnset(request.authorizationRuleName)) {
    query['AuthorizationRuleName'] = request.authorizationRuleName;
  }
  if (!Util.isUnset(request.authorizationRuleStatus)) {
    query['AuthorizationRuleStatus'] = request.authorizationRuleStatus;
  }
  if (!Util.isUnset(request.destination)) {
    query['Destination'] = request.destination;
  }
  if (!Util.isUnset(request.destinationPort)) {
    query['DestinationPort'] = request.destinationPort;
  }
  if (!Util.isUnset(request.destinationType)) {
    query['DestinationType'] = request.destinationType;
  }
  if (!Util.isUnset(request.ioTCloudConnectorGroupId)) {
    query['IoTCloudConnectorGroupId'] = request.ioTCloudConnectorGroupId;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.policy)) {
    query['Policy'] = request.policy;
  }
  if (!Util.isUnset(request.protocol)) {
    query['Protocol'] = request.protocol;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListGroupAuthorizationRules',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listGroupAuthorizationRules(request: ListGroupAuthorizationRulesRequest): ListGroupAuthorizationRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listGroupAuthorizationRulesWithOptions(request, runtime);
}

model ListGroupDNSServiceRulesRequest {
  DNSServiceRuleIds?: [ string ](name='DNSServiceRuleIds'),
  DNSServiceRuleName?: [ string ](name='DNSServiceRuleName'),
  DNSServiceRuleStatus?: [ string ](name='DNSServiceRuleStatus'),
  destination?: [ string ](name='Destination'),
  ioTCloudConnectorGroupId?: string(name='IoTCloudConnectorGroupId', example='iotccg-g00epppbi9di9y****'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  serviceType?: string(name='ServiceType', example='Normal'),
  source?: [ string ](name='Source'),
}

model ListGroupDNSServiceRulesResponseBody = {
  DNSServiceRules?: [ 
    {
      DNSServiceRuleDescription?: string(name='DNSServiceRuleDescription', example='description'),
      DNSServiceRuleId?: string(name='DNSServiceRuleId', example='gar-ffnn1ewe2nmf3y****'),
      DNSServiceRuleName?: string(name='DNSServiceRuleName', example='test'),
      DNSServiceRuleStatus?: string(name='DNSServiceRuleStatus', example='Created'),
      destination?: string(name='Destination', example='192.168.0.2'),
      ioTCloudConnectorGroupId?: string(name='IoTCloudConnectorGroupId', example='iotccg-g00epppbi9di9y****'),
      serviceType?: string(name='ServiceType', example='Normal'),
      source?: string(name='Source', example='100.100.2.136'),
    }
  ](name='DNSServiceRules'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', example='77111A6A-56BA-59B2-8CAA-7CBF21648FB8'),
  totalCount?: int32(name='TotalCount', example='10'),
}

model ListGroupDNSServiceRulesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListGroupDNSServiceRulesResponseBody(name='body'),
}

async function listGroupDNSServiceRulesWithOptions(request: ListGroupDNSServiceRulesRequest, runtime: Util.RuntimeOptions): ListGroupDNSServiceRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DNSServiceRuleIds)) {
    query['DNSServiceRuleIds'] = request.DNSServiceRuleIds;
  }
  if (!Util.isUnset(request.DNSServiceRuleName)) {
    query['DNSServiceRuleName'] = request.DNSServiceRuleName;
  }
  if (!Util.isUnset(request.DNSServiceRuleStatus)) {
    query['DNSServiceRuleStatus'] = request.DNSServiceRuleStatus;
  }
  if (!Util.isUnset(request.destination)) {
    query['Destination'] = request.destination;
  }
  if (!Util.isUnset(request.ioTCloudConnectorGroupId)) {
    query['IoTCloudConnectorGroupId'] = request.ioTCloudConnectorGroupId;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.serviceType)) {
    query['ServiceType'] = request.serviceType;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListGroupDNSServiceRules',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listGroupDNSServiceRules(request: ListGroupDNSServiceRulesRequest): ListGroupDNSServiceRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listGroupDNSServiceRulesWithOptions(request, runtime);
}

model ListGroupIpMappingRulesRequest {
  destinationIps?: [ string ](name='DestinationIps'),
  ioTCloudConnectorGroupId?: string(name='IoTCloudConnectorGroupId', example='iotccg-g00epppbi9di9y****'),
  ipMappingRuleIds?: [ string ](name='IpMappingRuleIds'),
  ipMappingRuleNames?: [ string ](name='IpMappingRuleNames'),
  ipMappingRuleStatuses?: [ string ](name='IpMappingRuleStatuses'),
  mappingIps?: [ string ](name='MappingIps'),
  maxResults?: int32(name='MaxResults', example='20'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model ListGroupIpMappingRulesResponseBody = {
  ipMappingRules?: [ 
    {
      destinationIp?: string(name='DestinationIp', example='192.168.10.8'),
      ioTCloudConnectorGroupId?: string(name='IoTCloudConnectorGroupId', example='iotccg-g00epppbi9di9y****'),
      ipMappingRuleDescription?: string(name='IpMappingRuleDescription', example='description'),
      ipMappingRuleId?: string(name='IpMappingRuleId', example='im-irrp3bzuu5nrbx****'),
      ipMappingRuleName?: string(name='IpMappingRuleName', example='name'),
      ipMappingRuleStatus?: string(name='IpMappingRuleStatus', example='Created'),
      mappingIp?: string(name='MappingIp', example='47.0.XX.XX'),
    }
  ](name='IpMappingRules'),
  maxResults?: int32(name='MaxResults', example='20'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
  totalCount?: int32(name='TotalCount', example='10'),
}

model ListGroupIpMappingRulesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListGroupIpMappingRulesResponseBody(name='body'),
}

async function listGroupIpMappingRulesWithOptions(request: ListGroupIpMappingRulesRequest, runtime: Util.RuntimeOptions): ListGroupIpMappingRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.destinationIps)) {
    query['DestinationIps'] = request.destinationIps;
  }
  if (!Util.isUnset(request.ioTCloudConnectorGroupId)) {
    query['IoTCloudConnectorGroupId'] = request.ioTCloudConnectorGroupId;
  }
  if (!Util.isUnset(request.ipMappingRuleIds)) {
    query['IpMappingRuleIds'] = request.ipMappingRuleIds;
  }
  if (!Util.isUnset(request.ipMappingRuleNames)) {
    query['IpMappingRuleNames'] = request.ipMappingRuleNames;
  }
  if (!Util.isUnset(request.ipMappingRuleStatuses)) {
    query['IpMappingRuleStatuses'] = request.ipMappingRuleStatuses;
  }
  if (!Util.isUnset(request.mappingIps)) {
    query['MappingIps'] = request.mappingIps;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListGroupIpMappingRules',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listGroupIpMappingRules(request: ListGroupIpMappingRulesRequest): ListGroupIpMappingRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listGroupIpMappingRulesWithOptions(request, runtime);
}

model ListIoTCloudConnectorAvailableZonesRequest {
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model ListIoTCloudConnectorAvailableZonesResponseBody = {
  availableZoneList?: [ string ](name='AvailableZoneList'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  requestId?: string(name='RequestId', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model ListIoTCloudConnectorAvailableZonesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListIoTCloudConnectorAvailableZonesResponseBody(name='body'),
}

async function listIoTCloudConnectorAvailableZonesWithOptions(request: ListIoTCloudConnectorAvailableZonesRequest, runtime: Util.RuntimeOptions): ListIoTCloudConnectorAvailableZonesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListIoTCloudConnectorAvailableZones',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listIoTCloudConnectorAvailableZones(request: ListIoTCloudConnectorAvailableZonesRequest): ListIoTCloudConnectorAvailableZonesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listIoTCloudConnectorAvailableZonesWithOptions(request, runtime);
}

model ListIoTCloudConnectorEIPsRequest {
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  maxResults?: int32(name='MaxResults', example='20'),
  nextToken?: string(name='NextToken', example='NextToken'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model ListIoTCloudConnectorEIPsResponseBody = {
  EIPs?: [ string ](name='EIPs'),
  maxResults?: int32(name='MaxResults', example='20'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
  totalCount?: int32(name='TotalCount', example='10'),
}

model ListIoTCloudConnectorEIPsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListIoTCloudConnectorEIPsResponseBody(name='body'),
}

async function listIoTCloudConnectorEIPsWithOptions(request: ListIoTCloudConnectorEIPsRequest, runtime: Util.RuntimeOptions): ListIoTCloudConnectorEIPsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListIoTCloudConnectorEIPs',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listIoTCloudConnectorEIPs(request: ListIoTCloudConnectorEIPsRequest): ListIoTCloudConnectorEIPsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listIoTCloudConnectorEIPsWithOptions(request, runtime);
}

model ListIoTCloudConnectorGroupsRequest {
  ioTCloudConnectorGroupIds?: [ string ](name='IoTCloudConnectorGroupIds'),
  ioTCloudConnectorGroupName?: [ string ](name='IoTCloudConnectorGroupName'),
  ioTCloudConnectorGroupStatus?: [ string ](name='IoTCloudConnectorGroupStatus'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  type?: string(name='Type', example='Standard'),
}

model ListIoTCloudConnectorGroupsResponseBody = {
  ioTCloudConnectorGroups?: [ 
    {
      createTime?: long(name='CreateTime', example='2021-10-01 00:00:00'),
      description?: string(name='Description', example='test'),
      ioTCloudConnectorGroupId?: string(name='IoTCloudConnectorGroupId', example='iotccg-g00epppbi9di9y****'),
      ioTCloudConnectorGroupStatus?: string(name='IoTCloudConnectorGroupStatus', example='Created'),
      ioTCloudConnectors?: [ 
        {
          APN?: string(name='APN', example='CMWAP'),
          createTime?: long(name='CreateTime', example='2021-10-01 00:00:00'),
          ISP?: string(name='ISP', example='mobile'),
          ioTCloudConnectorDescription?: string(name='IoTCloudConnectorDescription', example='cc01'),
          ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
          ioTCloudConnectorName?: string(name='IoTCloudConnectorName', example='cc01'),
          ioTCloudConnectorStatus?: string(name='IoTCloudConnectorStatus', example='Created'),
          serviceType?: string(name='ServiceType', example='Normal'),
        }
      ](name='IoTCloudConnectors'),
      name?: string(name='Name', example='cctest'),
      serviceType?: string(name='ServiceType', example='Normal'),
      type?: string(name='Type', example='Standard'),
    }
  ](name='IoTCloudConnectorGroups'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
  totalCount?: int32(name='TotalCount', example='10'),
}

model ListIoTCloudConnectorGroupsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListIoTCloudConnectorGroupsResponseBody(name='body'),
}

async function listIoTCloudConnectorGroupsWithOptions(request: ListIoTCloudConnectorGroupsRequest, runtime: Util.RuntimeOptions): ListIoTCloudConnectorGroupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ioTCloudConnectorGroupIds)) {
    query['IoTCloudConnectorGroupIds'] = request.ioTCloudConnectorGroupIds;
  }
  if (!Util.isUnset(request.ioTCloudConnectorGroupName)) {
    query['IoTCloudConnectorGroupName'] = request.ioTCloudConnectorGroupName;
  }
  if (!Util.isUnset(request.ioTCloudConnectorGroupStatus)) {
    query['IoTCloudConnectorGroupStatus'] = request.ioTCloudConnectorGroupStatus;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListIoTCloudConnectorGroups',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listIoTCloudConnectorGroups(request: ListIoTCloudConnectorGroupsRequest): ListIoTCloudConnectorGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listIoTCloudConnectorGroupsWithOptions(request, runtime);
}

model ListIoTCloudConnectorsRequest {
  APN?: [ string ](name='APN'),
  ISP?: [ string ](name='ISP'),
  ioTCloudConnectorGroupId?: string(name='IoTCloudConnectorGroupId', example='iotccg-g00epppbi9di9y****'),
  ioTCloudConnectorIds?: [ string ](name='IoTCloudConnectorIds'),
  ioTCloudConnectorName?: [ string ](name='IoTCloudConnectorName'),
  ioTCloudConnectorStatus?: [ string ](name='IoTCloudConnectorStatus'),
  isInGroup?: boolean(name='IsInGroup', example='false'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='caeba0bbb2be03f84eb48b699f0a****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  vpcId?: [ string ](name='VpcId'),
}

model ListIoTCloudConnectorsResponseBody = {
  ioTCloudConnectors?: [ 
    {
      APN?: string(name='APN', example='CMWAP'),
      createTime?: long(name='CreateTime', example='2021-10-01T00:00:00Z'),
      grantAliUid?: string(name='GrantAliUid', example='253460731706911258'),
      ISP?: string(name='ISP', example='mobile'),
      ioTCloudConnectorBusinessStatus?: string(name='IoTCloudConnectorBusinessStatus', example='Normal'),
      ioTCloudConnectorDescription?: string(name='IoTCloudConnectorDescription', example='test'),
      ioTCloudConnectorGroupId?: string(name='IoTCloudConnectorGroupId', example='iotccg-g00epppbi9di9y****'),
      ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
      ioTCloudConnectorName?: string(name='IoTCloudConnectorName', example='test'),
      ioTCloudConnectorStatus?: string(name='IoTCloudConnectorStatus', example='Created'),
      ipFeature?: string(name='IpFeature', example='192.168.0.1'),
      mode?: string(name='Mode', example='PassThrough'),
      modifyTime?: long(name='ModifyTime', example='2021-10-01T10:00:00Z'),
      rateLimit?: long(name='RateLimit', example='2'),
      serviceType?: string(name='ServiceType', example='Normal'),
      type?: string(name='Type', example='Standard'),
      vSwitchList?: [ string ](name='VSwitchList'),
      vpcId?: string(name='VpcId', example='vpc-bp1aevy8sofi8mh1q****'),
      wildcardDomainEnabled?: boolean(name='WildcardDomainEnabled', example='false'),
    }
  ](name='IoTCloudConnectors'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  totalCount?: int32(name='TotalCount', example='20'),
}

model ListIoTCloudConnectorsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListIoTCloudConnectorsResponseBody(name='body'),
}

async function listIoTCloudConnectorsWithOptions(request: ListIoTCloudConnectorsRequest, runtime: Util.RuntimeOptions): ListIoTCloudConnectorsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.APN)) {
    query['APN'] = request.APN;
  }
  if (!Util.isUnset(request.ISP)) {
    query['ISP'] = request.ISP;
  }
  if (!Util.isUnset(request.ioTCloudConnectorGroupId)) {
    query['IoTCloudConnectorGroupId'] = request.ioTCloudConnectorGroupId;
  }
  if (!Util.isUnset(request.ioTCloudConnectorIds)) {
    query['IoTCloudConnectorIds'] = request.ioTCloudConnectorIds;
  }
  if (!Util.isUnset(request.ioTCloudConnectorName)) {
    query['IoTCloudConnectorName'] = request.ioTCloudConnectorName;
  }
  if (!Util.isUnset(request.ioTCloudConnectorStatus)) {
    query['IoTCloudConnectorStatus'] = request.ioTCloudConnectorStatus;
  }
  if (!Util.isUnset(request.isInGroup)) {
    query['IsInGroup'] = request.isInGroup;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListIoTCloudConnectors',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listIoTCloudConnectors(request: ListIoTCloudConnectorsRequest): ListIoTCloudConnectorsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listIoTCloudConnectorsWithOptions(request, runtime);
}

model ListIoTCoudConnectorBackhaulRouteRequest {
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  maxResults?: int32(name='MaxResults', example='20'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model ListIoTCoudConnectorBackhaulRouteResponseBody = {
  maxResults?: int32(name='MaxResults', example='20'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  routes?: [ 
    {
      description?: string(name='Description', example='test'),
      destinationCidrBlock?: string(name='DestinationCidrBlock', example='192.168.2.0/24'),
      nextHopId?: string(name='NextHopId', example='eni-bp1d66qjxb3qoin3****'),
      nextHopType?: string(name='NextHopType', example='NetworkInterface'),
      status?: string(name='Status', example='Published'),
    }
  ](name='Routes'),
  totalCount?: int32(name='TotalCount', example='10'),
}

model ListIoTCoudConnectorBackhaulRouteResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListIoTCoudConnectorBackhaulRouteResponseBody(name='body'),
}

async function listIoTCoudConnectorBackhaulRouteWithOptions(request: ListIoTCoudConnectorBackhaulRouteRequest, runtime: Util.RuntimeOptions): ListIoTCoudConnectorBackhaulRouteResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListIoTCoudConnectorBackhaulRoute',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listIoTCoudConnectorBackhaulRoute(request: ListIoTCoudConnectorBackhaulRouteRequest): ListIoTCoudConnectorBackhaulRouteResponse {
  var runtime = new Util.RuntimeOptions{};
  return listIoTCoudConnectorBackhaulRouteWithOptions(request, runtime);
}

model ListIpMappingRulesRequest {
  destinationIps?: [ string ](name='DestinationIps'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  ipMappingRuleIds?: [ string ](name='IpMappingRuleIds'),
  ipMappingRuleNames?: [ string ](name='IpMappingRuleNames'),
  ipMappingRuleStatuses?: [ string ](name='IpMappingRuleStatuses'),
  mappingIps?: [ string ](name='MappingIps'),
  maxResults?: int32(name='MaxResults', example='20'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model ListIpMappingRulesResponseBody = {
  ipMappingRules?: [ 
    {
      destinationIp?: string(name='DestinationIp', example='192.168.10.8'),
      ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
      ipMappingRuleDescription?: string(name='IpMappingRuleDescription', example='description'),
      ipMappingRuleId?: string(name='IpMappingRuleId', example='im-irrp3bzuu5nrbx****'),
      ipMappingRuleName?: string(name='IpMappingRuleName', example='name'),
      ipMappingRuleStatus?: string(name='IpMappingRuleStatus', example='Created'),
      mappingIp?: string(name='MappingIp', example='47.0.XX.XX'),
    }
  ](name='IpMappingRules'),
  maxResults?: int32(name='MaxResults', example='20'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
  totalCount?: int32(name='TotalCount', example='10'),
}

model ListIpMappingRulesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListIpMappingRulesResponseBody(name='body'),
}

async function listIpMappingRulesWithOptions(request: ListIpMappingRulesRequest, runtime: Util.RuntimeOptions): ListIpMappingRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.destinationIps)) {
    query['DestinationIps'] = request.destinationIps;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.ipMappingRuleIds)) {
    query['IpMappingRuleIds'] = request.ipMappingRuleIds;
  }
  if (!Util.isUnset(request.ipMappingRuleNames)) {
    query['IpMappingRuleNames'] = request.ipMappingRuleNames;
  }
  if (!Util.isUnset(request.ipMappingRuleStatuses)) {
    query['IpMappingRuleStatuses'] = request.ipMappingRuleStatuses;
  }
  if (!Util.isUnset(request.mappingIps)) {
    query['MappingIps'] = request.mappingIps;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListIpMappingRules',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listIpMappingRules(request: ListIpMappingRulesRequest): ListIpMappingRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listIpMappingRulesWithOptions(request, runtime);
}

model ListRegionsRequest {
  acceptLanguage?: string(name='AcceptLanguage', example='zh-CN'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model ListRegionsResponseBody = {
  regions?: [ 
    {
      localName?: string(name='LocalName'),
      regionEndpoint?: string(name='RegionEndpoint', example='cciot.cn-hangzhou.aliyuncs.com'),
      regionId?: string(name='RegionId', example='cn-hangzhou'),
    }
  ](name='Regions'),
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model ListRegionsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListRegionsResponseBody(name='body'),
}

async function listRegionsWithOptions(request: ListRegionsRequest, runtime: Util.RuntimeOptions): ListRegionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceptLanguage)) {
    query['AcceptLanguage'] = request.acceptLanguage;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListRegions',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listRegions(request: ListRegionsRequest): ListRegionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listRegionsWithOptions(request, runtime);
}

model ListServiceRequest {
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  maxResults?: int32(name='MaxResults', example='20'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceStatuses?: [ string ](name='ResourceStatuses'),
  serviceIds?: [ string ](name='ServiceIds'),
  serviceNames?: [ string ](name='ServiceNames'),
}

model ListServiceResponseBody = {
  maxResults?: int32(name='MaxResults', example='20'),
  nextToken?: string(name='NextToken', example='NextToken	FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  services?: [ 
    {
      ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
      serviceDescription?: string(name='ServiceDescription', example='service_description'),
      serviceId?: string(name='ServiceId', example='c910061f-****-44e6-b659-***c'),
      serviceName?: string(name='ServiceName', example='service_name'),
      serviceStatus?: string(name='ServiceStatus', example='Created'),
    }
  ](name='Services'),
  totalCount?: int32(name='TotalCount', example='10'),
}

model ListServiceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListServiceResponseBody(name='body'),
}

async function listServiceWithOptions(request: ListServiceRequest, runtime: Util.RuntimeOptions): ListServiceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceStatuses)) {
    query['ResourceStatuses'] = request.resourceStatuses;
  }
  if (!Util.isUnset(request.serviceIds)) {
    query['ServiceIds'] = request.serviceIds;
  }
  if (!Util.isUnset(request.serviceNames)) {
    query['ServiceNames'] = request.serviceNames;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListService',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listService(request: ListServiceRequest): ListServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return listServiceWithOptions(request, runtime);
}

model ListServiceEntriesRequest {
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  maxResults?: int32(name='MaxResults', example='20'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  serviceEntryIds?: [ string ](name='ServiceEntryIds'),
  serviceEntryName?: [ string ](name='ServiceEntryName'),
  serviceEntryStatus?: [ string ](name='ServiceEntryStatus'),
  serviceId?: string(name='ServiceId', example='c910061f-****-44e6-b659-***c'),
  target?: [ string ](name='Target'),
  targetType?: [ string ](name='TargetType'),
}

model ListServiceEntriesResponseBody = {
  maxResults?: int32(name='MaxResults', example='20'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
  serviceEntries?: [ 
    {
      serviceEntryDescription?: string(name='ServiceEntryDescription', example='entry_description'),
      serviceEntryId?: string(name='ServiceEntryId', example='fwd-119smw5tkasdf****'),
      serviceEntryName?: string(name='ServiceEntryName', example='entry_name'),
      serviceEntryStatus?: string(name='ServiceEntryStatus', example='Created'),
      serviceId?: string(name='ServiceId', example='c910061f-****-44e6-b659-***c'),
      target?: string(name='Target', example='192.168.1.32/27'),
      targetType?: string(name='TargetType', example='Cidr'),
    }
  ](name='ServiceEntries'),
  totalCount?: int32(name='TotalCount', example='10'),
}

model ListServiceEntriesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListServiceEntriesResponseBody(name='body'),
}

async function listServiceEntriesWithOptions(request: ListServiceEntriesRequest, runtime: Util.RuntimeOptions): ListServiceEntriesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.serviceEntryIds)) {
    query['ServiceEntryIds'] = request.serviceEntryIds;
  }
  if (!Util.isUnset(request.serviceEntryName)) {
    query['ServiceEntryName'] = request.serviceEntryName;
  }
  if (!Util.isUnset(request.serviceEntryStatus)) {
    query['ServiceEntryStatus'] = request.serviceEntryStatus;
  }
  if (!Util.isUnset(request.serviceId)) {
    query['ServiceId'] = request.serviceId;
  }
  if (!Util.isUnset(request.target)) {
    query['Target'] = request.target;
  }
  if (!Util.isUnset(request.targetType)) {
    query['TargetType'] = request.targetType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListServiceEntries',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listServiceEntries(request: ListServiceEntriesRequest): ListServiceEntriesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listServiceEntriesWithOptions(request, runtime);
}

model MoveAuthorizationRuleToDNSServiceRequest {
  authorizationRuleId?: string(name='AuthorizationRuleId', example='ar-la6sn6gng90e1x****'),
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-1y6h8z7imd2yu4****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model MoveAuthorizationRuleToDNSServiceResponseBody = {
  requestId?: string(name='RequestId', example='862D2D7E-E6A9-5645-9CA0-64B520256A7B'),
}

model MoveAuthorizationRuleToDNSServiceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: MoveAuthorizationRuleToDNSServiceResponseBody(name='body'),
}

async function moveAuthorizationRuleToDNSServiceWithOptions(request: MoveAuthorizationRuleToDNSServiceRequest, runtime: Util.RuntimeOptions): MoveAuthorizationRuleToDNSServiceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authorizationRuleId)) {
    query['AuthorizationRuleId'] = request.authorizationRuleId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'MoveAuthorizationRuleToDNSService',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function moveAuthorizationRuleToDNSService(request: MoveAuthorizationRuleToDNSServiceRequest): MoveAuthorizationRuleToDNSServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return moveAuthorizationRuleToDNSServiceWithOptions(request, runtime);
}

model MoveGroupAuthorizationRuleToDNSServiceRequest {
  authorizationRuleId?: string(name='AuthorizationRuleId', example='gar-ez91t41jvi6tr8****'),
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorGroupId?: string(name='IoTCloudConnectorGroupId', example='iotccg-g00epppbi9di9y****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model MoveGroupAuthorizationRuleToDNSServiceResponseBody = {
  requestId?: string(name='RequestId', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
}

model MoveGroupAuthorizationRuleToDNSServiceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: MoveGroupAuthorizationRuleToDNSServiceResponseBody(name='body'),
}

async function moveGroupAuthorizationRuleToDNSServiceWithOptions(request: MoveGroupAuthorizationRuleToDNSServiceRequest, runtime: Util.RuntimeOptions): MoveGroupAuthorizationRuleToDNSServiceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authorizationRuleId)) {
    query['AuthorizationRuleId'] = request.authorizationRuleId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorGroupId)) {
    query['IoTCloudConnectorGroupId'] = request.ioTCloudConnectorGroupId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'MoveGroupAuthorizationRuleToDNSService',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function moveGroupAuthorizationRuleToDNSService(request: MoveGroupAuthorizationRuleToDNSServiceRequest): MoveGroupAuthorizationRuleToDNSServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return moveGroupAuthorizationRuleToDNSServiceWithOptions(request, runtime);
}

model OpenIoTCloudConnectorServiceRequest {
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model OpenIoTCloudConnectorServiceResponseBody = {
  requestId?: string(name='RequestId', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
}

model OpenIoTCloudConnectorServiceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: OpenIoTCloudConnectorServiceResponseBody(name='body'),
}

async function openIoTCloudConnectorServiceWithOptions(request: OpenIoTCloudConnectorServiceRequest, runtime: Util.RuntimeOptions): OpenIoTCloudConnectorServiceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'OpenIoTCloudConnectorService',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function openIoTCloudConnectorService(request: OpenIoTCloudConnectorServiceRequest): OpenIoTCloudConnectorServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return openIoTCloudConnectorServiceWithOptions(request, runtime);
}

model RemoveIoTCloudConnectorFromGroupRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='true'),
  ioTCloudConnectorGroupId?: string(name='IoTCloudConnectorGroupId', example='iotccg-g00epppbi9di9y****'),
  ioTCloudConnectorId?: [ string ](name='IoTCloudConnectorId'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model RemoveIoTCloudConnectorFromGroupResponseBody = {
  requestId?: string(name='RequestId', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
}

model RemoveIoTCloudConnectorFromGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RemoveIoTCloudConnectorFromGroupResponseBody(name='body'),
}

async function removeIoTCloudConnectorFromGroupWithOptions(request: RemoveIoTCloudConnectorFromGroupRequest, runtime: Util.RuntimeOptions): RemoveIoTCloudConnectorFromGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorGroupId)) {
    query['IoTCloudConnectorGroupId'] = request.ioTCloudConnectorGroupId;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RemoveIoTCloudConnectorFromGroup',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function removeIoTCloudConnectorFromGroup(request: RemoveIoTCloudConnectorFromGroupRequest): RemoveIoTCloudConnectorFromGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeIoTCloudConnectorFromGroupWithOptions(request, runtime);
}

model RevertIoTCloudConnectorRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model RevertIoTCloudConnectorResponseBody = {
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
  resourceId?: string(name='ResourceId', example='iotcc-bp1odcab8tmno0hdq****'),
}

model RevertIoTCloudConnectorResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RevertIoTCloudConnectorResponseBody(name='body'),
}

async function revertIoTCloudConnectorWithOptions(request: RevertIoTCloudConnectorRequest, runtime: Util.RuntimeOptions): RevertIoTCloudConnectorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RevertIoTCloudConnector',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function revertIoTCloudConnector(request: RevertIoTCloudConnectorRequest): RevertIoTCloudConnectorResponse {
  var runtime = new Util.RuntimeOptions{};
  return revertIoTCloudConnectorWithOptions(request, runtime);
}

model SubmitDiagnoseTaskForSingleCardRequest {
  beginTime?: long(name='BeginTime', example='1643077466'),
  destination?: string(name='Destination', example='114.114.XX.XX'),
  destinationType?: string(name='DestinationType', example='IP'),
  endTime?: long(name='EndTime', example='1643077666'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-smy9a5ockzp08n****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceUid?: long(name='ResourceUid', example='253460731706911258'),
  source?: string(name='Source', example='169.254.XX.XX'),
  sourceType?: string(name='SourceType'),
}

model SubmitDiagnoseTaskForSingleCardResponseBody = {
  diagnoseTaskId?: string(name='DiagnoseTaskId', example='diagnoseTask-bp2qhwdp2n9x6zkvq****'),
  requestId?: string(name='RequestId', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
}

model SubmitDiagnoseTaskForSingleCardResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SubmitDiagnoseTaskForSingleCardResponseBody(name='body'),
}

async function submitDiagnoseTaskForSingleCardWithOptions(request: SubmitDiagnoseTaskForSingleCardRequest, runtime: Util.RuntimeOptions): SubmitDiagnoseTaskForSingleCardResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.beginTime)) {
    query['BeginTime'] = request.beginTime;
  }
  if (!Util.isUnset(request.destination)) {
    query['Destination'] = request.destination;
  }
  if (!Util.isUnset(request.destinationType)) {
    query['DestinationType'] = request.destinationType;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceUid)) {
    query['ResourceUid'] = request.resourceUid;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  if (!Util.isUnset(request.sourceType)) {
    query['SourceType'] = request.sourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SubmitDiagnoseTaskForSingleCard',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitDiagnoseTaskForSingleCard(request: SubmitDiagnoseTaskForSingleCardRequest): SubmitDiagnoseTaskForSingleCardResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitDiagnoseTaskForSingleCardWithOptions(request, runtime);
}

model UpdateAuthorizationRuleAttributeRequest {
  authorizationRuleDescription?: string(name='AuthorizationRuleDescription', example='rule01'),
  authorizationRuleId?: string(name='AuthorizationRuleId', example='ar-1234abcb8tmno0hdq****'),
  authorizationRuleName?: string(name='AuthorizationRuleName', example='rule01'),
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  destination?: string(name='Destination', example='192.168.XX.XX'),
  destinationPort?: string(name='DestinationPort', example='80/80'),
  destinationType?: string(name='DestinationType', example='Cidr'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  policy?: string(name='Policy', example='Permit'),
  protocol?: string(name='Protocol', example='tcp'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  sourceCidrs?: [ string ](name='SourceCidrs'),
}

model UpdateAuthorizationRuleAttributeResponseBody = {
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model UpdateAuthorizationRuleAttributeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateAuthorizationRuleAttributeResponseBody(name='body'),
}

async function updateAuthorizationRuleAttributeWithOptions(request: UpdateAuthorizationRuleAttributeRequest, runtime: Util.RuntimeOptions): UpdateAuthorizationRuleAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authorizationRuleDescription)) {
    query['AuthorizationRuleDescription'] = request.authorizationRuleDescription;
  }
  if (!Util.isUnset(request.authorizationRuleId)) {
    query['AuthorizationRuleId'] = request.authorizationRuleId;
  }
  if (!Util.isUnset(request.authorizationRuleName)) {
    query['AuthorizationRuleName'] = request.authorizationRuleName;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.destination)) {
    query['Destination'] = request.destination;
  }
  if (!Util.isUnset(request.destinationPort)) {
    query['DestinationPort'] = request.destinationPort;
  }
  if (!Util.isUnset(request.destinationType)) {
    query['DestinationType'] = request.destinationType;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.policy)) {
    query['Policy'] = request.policy;
  }
  if (!Util.isUnset(request.protocol)) {
    query['Protocol'] = request.protocol;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.sourceCidrs)) {
    query['SourceCidrs'] = request.sourceCidrs;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAuthorizationRuleAttribute',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateAuthorizationRuleAttribute(request: UpdateAuthorizationRuleAttributeRequest): UpdateAuthorizationRuleAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAuthorizationRuleAttributeWithOptions(request, runtime);
}

model UpdateConnectionPoolAttributeRequest {
  cidrs?: [ string ](name='Cidrs'),
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  connectionPoolDescription?: string(name='ConnectionPoolDescription', example='pool01'),
  connectionPoolId?: string(name='ConnectionPoolId', example='cp-bp11234abctmno0hdq****'),
  connectionPoolName?: string(name='ConnectionPoolName', example='pool01'),
  count?: long(name='Count', example='2'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model UpdateConnectionPoolAttributeResponseBody = {
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model UpdateConnectionPoolAttributeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateConnectionPoolAttributeResponseBody(name='body'),
}

async function updateConnectionPoolAttributeWithOptions(request: UpdateConnectionPoolAttributeRequest, runtime: Util.RuntimeOptions): UpdateConnectionPoolAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.cidrs)) {
    query['Cidrs'] = request.cidrs;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.connectionPoolDescription)) {
    query['ConnectionPoolDescription'] = request.connectionPoolDescription;
  }
  if (!Util.isUnset(request.connectionPoolId)) {
    query['ConnectionPoolId'] = request.connectionPoolId;
  }
  if (!Util.isUnset(request.connectionPoolName)) {
    query['ConnectionPoolName'] = request.connectionPoolName;
  }
  if (!Util.isUnset(request.count)) {
    query['Count'] = request.count;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateConnectionPoolAttribute',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateConnectionPoolAttribute(request: UpdateConnectionPoolAttributeRequest): UpdateConnectionPoolAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateConnectionPoolAttributeWithOptions(request, runtime);
}

model UpdateDNSServiceRuleAttributeRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  DNSServiceRuleDescription?: string(name='DNSServiceRuleDescription', example='description'),
  DNSServiceRuleId?: string(name='DNSServiceRuleId', example='ar-r56ijpurlu50gi****'),
  DNSServiceRuleName?: string(name='DNSServiceRuleName', example='test'),
  destination?: string(name='Destination', example='192.168.0.2'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-1y6h8z7imd2yu4****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  serviceType?: string(name='ServiceType', example='Normal'),
  source?: string(name='Source', example='100.100.2.138'),
}

model UpdateDNSServiceRuleAttributeResponseBody = {
  requestId?: string(name='RequestId', example='BC6D1C1D-6DBD-568C-B867-BC9CA699ED01'),
}

model UpdateDNSServiceRuleAttributeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateDNSServiceRuleAttributeResponseBody(name='body'),
}

async function updateDNSServiceRuleAttributeWithOptions(request: UpdateDNSServiceRuleAttributeRequest, runtime: Util.RuntimeOptions): UpdateDNSServiceRuleAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.DNSServiceRuleDescription)) {
    query['DNSServiceRuleDescription'] = request.DNSServiceRuleDescription;
  }
  if (!Util.isUnset(request.DNSServiceRuleId)) {
    query['DNSServiceRuleId'] = request.DNSServiceRuleId;
  }
  if (!Util.isUnset(request.DNSServiceRuleName)) {
    query['DNSServiceRuleName'] = request.DNSServiceRuleName;
  }
  if (!Util.isUnset(request.destination)) {
    query['Destination'] = request.destination;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.serviceType)) {
    query['ServiceType'] = request.serviceType;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateDNSServiceRuleAttribute',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateDNSServiceRuleAttribute(request: UpdateDNSServiceRuleAttributeRequest): UpdateDNSServiceRuleAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateDNSServiceRuleAttributeWithOptions(request, runtime);
}

model UpdateGroupAuthorizationRuleAttributeRequest {
  authorizationRuleDescription?: string(name='AuthorizationRuleDescription', example='rule'),
  authorizationRuleId?: string(name='AuthorizationRuleId', example='gar-ez91t41jvi6tr8****'),
  authorizationRuleName?: string(name='AuthorizationRuleName', example='ruletest'),
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  destination?: string(name='Destination', example='47.0.XX.XX'),
  destinationPort?: string(name='DestinationPort', example='80/80'),
  destinationType?: string(name='DestinationType', example='Cidr'),
  dryRun?: boolean(name='DryRun', example='true'),
  ioTCloudConnectorGroupId?: string(name='IoTCloudConnectorGroupId', example='iotccg-g00epppbi9di9y****'),
  policy?: string(name='Policy', example='Permit'),
  protocol?: string(name='Protocol', example='tcp'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  sourceCidrs?: [ string ](name='SourceCidrs'),
}

model UpdateGroupAuthorizationRuleAttributeResponseBody = {
  authorizationRuleId?: string(name='AuthorizationRuleId', example='gar-ez91t41jvi6tr8****'),
  ioTCloudConnectorGroupId?: string(name='IoTCloudConnectorGroupId', example='iotccg-g00epppbi9di9y****'),
  requestId?: string(name='RequestId', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
}

model UpdateGroupAuthorizationRuleAttributeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateGroupAuthorizationRuleAttributeResponseBody(name='body'),
}

async function updateGroupAuthorizationRuleAttributeWithOptions(request: UpdateGroupAuthorizationRuleAttributeRequest, runtime: Util.RuntimeOptions): UpdateGroupAuthorizationRuleAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authorizationRuleDescription)) {
    query['AuthorizationRuleDescription'] = request.authorizationRuleDescription;
  }
  if (!Util.isUnset(request.authorizationRuleId)) {
    query['AuthorizationRuleId'] = request.authorizationRuleId;
  }
  if (!Util.isUnset(request.authorizationRuleName)) {
    query['AuthorizationRuleName'] = request.authorizationRuleName;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.destination)) {
    query['Destination'] = request.destination;
  }
  if (!Util.isUnset(request.destinationPort)) {
    query['DestinationPort'] = request.destinationPort;
  }
  if (!Util.isUnset(request.destinationType)) {
    query['DestinationType'] = request.destinationType;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorGroupId)) {
    query['IoTCloudConnectorGroupId'] = request.ioTCloudConnectorGroupId;
  }
  if (!Util.isUnset(request.policy)) {
    query['Policy'] = request.policy;
  }
  if (!Util.isUnset(request.protocol)) {
    query['Protocol'] = request.protocol;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.sourceCidrs)) {
    query['SourceCidrs'] = request.sourceCidrs;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateGroupAuthorizationRuleAttribute',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateGroupAuthorizationRuleAttribute(request: UpdateGroupAuthorizationRuleAttributeRequest): UpdateGroupAuthorizationRuleAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateGroupAuthorizationRuleAttributeWithOptions(request, runtime);
}

model UpdateGroupDNSServiceRuleAttributeRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  DNSServiceRuleDescription?: string(name='DNSServiceRuleDescription', example='description'),
  DNSServiceRuleId?: string(name='DNSServiceRuleId', example='gar-ffnn1ewe2nmf3y****'),
  DNSServiceRuleName?: string(name='DNSServiceRuleName', example='test'),
  destination?: string(name='Destination', example='192.168.0.2'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorGroupId?: string(name='IoTCloudConnectorGroupId', example='iotccg-g00epppbi9di9y****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  serviceType?: string(name='ServiceType', example='Normal'),
  source?: string(name='Source', example='100.100.2.136'),
}

model UpdateGroupDNSServiceRuleAttributeResponseBody = {
  requestId?: string(name='RequestId', example='77111A6A-56BA-59B2-8CAA-7CBF21648FB8'),
}

model UpdateGroupDNSServiceRuleAttributeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateGroupDNSServiceRuleAttributeResponseBody(name='body'),
}

async function updateGroupDNSServiceRuleAttributeWithOptions(request: UpdateGroupDNSServiceRuleAttributeRequest, runtime: Util.RuntimeOptions): UpdateGroupDNSServiceRuleAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.DNSServiceRuleDescription)) {
    query['DNSServiceRuleDescription'] = request.DNSServiceRuleDescription;
  }
  if (!Util.isUnset(request.DNSServiceRuleId)) {
    query['DNSServiceRuleId'] = request.DNSServiceRuleId;
  }
  if (!Util.isUnset(request.DNSServiceRuleName)) {
    query['DNSServiceRuleName'] = request.DNSServiceRuleName;
  }
  if (!Util.isUnset(request.destination)) {
    query['Destination'] = request.destination;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorGroupId)) {
    query['IoTCloudConnectorGroupId'] = request.ioTCloudConnectorGroupId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.serviceType)) {
    query['ServiceType'] = request.serviceType;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateGroupDNSServiceRuleAttribute',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateGroupDNSServiceRuleAttribute(request: UpdateGroupDNSServiceRuleAttributeRequest): UpdateGroupDNSServiceRuleAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateGroupDNSServiceRuleAttributeWithOptions(request, runtime);
}

model UpdateGroupIpMappingRuleRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  destinationIp?: string(name='DestinationIp', example='192.168.10.8'),
  dryRun?: boolean(name='DryRun', example='false'),
  groupIpMappingRuleId?: string(name='GroupIpMappingRuleId', example='im-irrp3bzuu5nrbx****'),
  ioTCloudConnectorGroupId?: string(name='IoTCloudConnectorGroupId', example='iotccg-g00epppbi9di9y****'),
  ipMappingRuleDescription?: string(name='IpMappingRuleDescription', example='description'),
  ipMappingRuleName?: string(name='IpMappingRuleName', example='name'),
  mappingIp?: string(name='MappingIp', example='47.0.XX.XX'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model UpdateGroupIpMappingRuleResponseBody = {
  authorizationRuleId?: string(name='AuthorizationRuleId', example='ar-1234abcb8tmno0hdq****'),
  ioTCloudConnectorGroupId?: string(name='IoTCloudConnectorGroupId', example='iotccg-g00epppbi9di9y****'),
  requestId?: string(name='RequestId', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
}

model UpdateGroupIpMappingRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateGroupIpMappingRuleResponseBody(name='body'),
}

async function updateGroupIpMappingRuleWithOptions(request: UpdateGroupIpMappingRuleRequest, runtime: Util.RuntimeOptions): UpdateGroupIpMappingRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.destinationIp)) {
    query['DestinationIp'] = request.destinationIp;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.groupIpMappingRuleId)) {
    query['GroupIpMappingRuleId'] = request.groupIpMappingRuleId;
  }
  if (!Util.isUnset(request.ioTCloudConnectorGroupId)) {
    query['IoTCloudConnectorGroupId'] = request.ioTCloudConnectorGroupId;
  }
  if (!Util.isUnset(request.ipMappingRuleDescription)) {
    query['IpMappingRuleDescription'] = request.ipMappingRuleDescription;
  }
  if (!Util.isUnset(request.ipMappingRuleName)) {
    query['IpMappingRuleName'] = request.ipMappingRuleName;
  }
  if (!Util.isUnset(request.mappingIp)) {
    query['MappingIp'] = request.mappingIp;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateGroupIpMappingRule',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateGroupIpMappingRule(request: UpdateGroupIpMappingRuleRequest): UpdateGroupIpMappingRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateGroupIpMappingRuleWithOptions(request, runtime);
}

model UpdateIoTCloudConnectorAttributeRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorDescription?: string(name='IoTCloudConnectorDescription', example='test'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  ioTCloudConnectorName?: string(name='IoTCloudConnectorName', example='test'),
  mode?: string(name='Mode', example='PassThrough'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  wildcardDomainEnabled?: boolean(name='WildcardDomainEnabled', example='true'),
}

model UpdateIoTCloudConnectorAttributeResponseBody = {
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
  resourceId?: string(name='ResourceId', example='iotcc-bp1odcab8tmno0hdq****'),
}

model UpdateIoTCloudConnectorAttributeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateIoTCloudConnectorAttributeResponseBody(name='body'),
}

async function updateIoTCloudConnectorAttributeWithOptions(request: UpdateIoTCloudConnectorAttributeRequest, runtime: Util.RuntimeOptions): UpdateIoTCloudConnectorAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorDescription)) {
    query['IoTCloudConnectorDescription'] = request.ioTCloudConnectorDescription;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.ioTCloudConnectorName)) {
    query['IoTCloudConnectorName'] = request.ioTCloudConnectorName;
  }
  if (!Util.isUnset(request.mode)) {
    query['Mode'] = request.mode;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.wildcardDomainEnabled)) {
    query['WildcardDomainEnabled'] = request.wildcardDomainEnabled;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateIoTCloudConnectorAttribute',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateIoTCloudConnectorAttribute(request: UpdateIoTCloudConnectorAttributeRequest): UpdateIoTCloudConnectorAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateIoTCloudConnectorAttributeWithOptions(request, runtime);
}

model UpdateIoTCloudConnectorGroupAttributeRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  description?: string(name='Description', example='description'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorGroupId?: string(name='IoTCloudConnectorGroupId', example='iotccg-g00epppbi9di9y****'),
  name?: string(name='Name', example='test'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model UpdateIoTCloudConnectorGroupAttributeResponseBody = {
  requestId?: string(name='RequestId', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model UpdateIoTCloudConnectorGroupAttributeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateIoTCloudConnectorGroupAttributeResponseBody(name='body'),
}

async function updateIoTCloudConnectorGroupAttributeWithOptions(request: UpdateIoTCloudConnectorGroupAttributeRequest, runtime: Util.RuntimeOptions): UpdateIoTCloudConnectorGroupAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorGroupId)) {
    query['IoTCloudConnectorGroupId'] = request.ioTCloudConnectorGroupId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateIoTCloudConnectorGroupAttribute',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateIoTCloudConnectorGroupAttribute(request: UpdateIoTCloudConnectorGroupAttributeRequest): UpdateIoTCloudConnectorGroupAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateIoTCloudConnectorGroupAttributeWithOptions(request, runtime);
}

model UpdateIpMappingRuleRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  destinationIp?: string(name='DestinationIp', example='192.168.10.8'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  ipMappingRuleDescription?: string(name='IpMappingRuleDescription', example='description'),
  ipMappingRuleId?: string(name='IpMappingRuleId', example='im-irrp3bzuu5nrbx****'),
  ipMappingRuleName?: string(name='IpMappingRuleName', example='name'),
  mappingIp?: string(name='MappingIp', example='47.0.XX.XX'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model UpdateIpMappingRuleResponseBody = {
  requestId?: string(name='RequestId', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model UpdateIpMappingRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateIpMappingRuleResponseBody(name='body'),
}

async function updateIpMappingRuleWithOptions(request: UpdateIpMappingRuleRequest, runtime: Util.RuntimeOptions): UpdateIpMappingRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.destinationIp)) {
    query['DestinationIp'] = request.destinationIp;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.ipMappingRuleDescription)) {
    query['IpMappingRuleDescription'] = request.ipMappingRuleDescription;
  }
  if (!Util.isUnset(request.ipMappingRuleId)) {
    query['IpMappingRuleId'] = request.ipMappingRuleId;
  }
  if (!Util.isUnset(request.ipMappingRuleName)) {
    query['IpMappingRuleName'] = request.ipMappingRuleName;
  }
  if (!Util.isUnset(request.mappingIp)) {
    query['MappingIp'] = request.mappingIp;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateIpMappingRule',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateIpMappingRule(request: UpdateIpMappingRuleRequest): UpdateIpMappingRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateIpMappingRuleWithOptions(request, runtime);
}

model UpdateServiceAttributeRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  serviceDescription?: string(name='ServiceDescription', example='service_description'),
  serviceId?: string(name='ServiceId', example='c910061f-****-44e6-b659-***c'),
  serviceName?: string(name='ServiceName', example='service_name'),
}

model UpdateServiceAttributeResponseBody = {
  requestId?: string(name='RequestId', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
}

model UpdateServiceAttributeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateServiceAttributeResponseBody(name='body'),
}

async function updateServiceAttributeWithOptions(request: UpdateServiceAttributeRequest, runtime: Util.RuntimeOptions): UpdateServiceAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.serviceDescription)) {
    query['ServiceDescription'] = request.serviceDescription;
  }
  if (!Util.isUnset(request.serviceId)) {
    query['ServiceId'] = request.serviceId;
  }
  if (!Util.isUnset(request.serviceName)) {
    query['ServiceName'] = request.serviceName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateServiceAttribute',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateServiceAttribute(request: UpdateServiceAttributeRequest): UpdateServiceAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateServiceAttributeWithOptions(request, runtime);
}

model UpdateServiceEntryAttributeRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ioTCloudConnectorId?: string(name='IoTCloudConnectorId', example='iotcc-bp1odcab8tmno0hdq****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  serviceEntryDescription?: string(name='ServiceEntryDescription', example='entry_description'),
  serviceEntryId?: string(name='ServiceEntryId', example='fwd-119smw5tkasdf****'),
  serviceEntryName?: string(name='ServiceEntryName', example='entry_name'),
  serviceId?: string(name='ServiceId', example='c910061f-****-44e6-b659-***c'),
}

model UpdateServiceEntryAttributeResponseBody = {
  requestId?: string(name='RequestId', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
}

model UpdateServiceEntryAttributeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateServiceEntryAttributeResponseBody(name='body'),
}

async function updateServiceEntryAttributeWithOptions(request: UpdateServiceEntryAttributeRequest, runtime: Util.RuntimeOptions): UpdateServiceEntryAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ioTCloudConnectorId)) {
    query['IoTCloudConnectorId'] = request.ioTCloudConnectorId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.serviceEntryDescription)) {
    query['ServiceEntryDescription'] = request.serviceEntryDescription;
  }
  if (!Util.isUnset(request.serviceEntryId)) {
    query['ServiceEntryId'] = request.serviceEntryId;
  }
  if (!Util.isUnset(request.serviceEntryName)) {
    query['ServiceEntryName'] = request.serviceEntryName;
  }
  if (!Util.isUnset(request.serviceId)) {
    query['ServiceId'] = request.serviceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateServiceEntryAttribute',
    version = '2021-05-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateServiceEntryAttribute(request: UpdateServiceEntryAttributeRequest): UpdateServiceEntryAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateServiceEntryAttributeWithOptions(request, runtime);
}

